-1

I have an applications that install two other application which has a "Help" option. Each of these application has a common help file but the contents should be displayed based on the index selected for the application in the "Table of Contents". If i open one application, the help of that particular application should be displayed.

My code looks like this for Appl1.

    private void Help_Click(Core.CommandBarButton Ctrl, ref bool CancelDefault)
    {
        if (System.IO.File.Exists(new PlugInConstants().HELP_FILE_Path))
        {                
            System.Windows.Forms.Help.ShowHelp(new System.Windows.Forms.Control(),
                new PlugInConstants().HELP_FILE_Path,
                System.Windows.Forms.HelpNavigator.TableOfContents, "Appl1");
        }
        else
        {
            System.Windows.Forms.MessageBox.Show(m_objLanguage.ERR_HELP_NOT_FOUND.Replace
                ("%1", m_objGlobalConfig.HelpFilename));
        }

        CancelDefault = false;
    }

and looks like this for Appl2

  private void HelpToolStripMenuItem_Click(object sender, EventArgs e)
    {
        helpToolStripMenuItem.Enabled = false;   
        string helpFilePath;
        helpFilePath = new TrayConstants().HELP_FILE_Path;

        if (System.IO.File.Exists(helpFilePath))
        {
            System.Windows.Forms.Help.ShowHelp(new System.Windows.Forms.Control(), 
                helpFilePath, System.Windows.Forms.HelpNavigator.TableOfContents, "Appl2") ;
        }
        else
        {
            if (m_helpPage == null)
                m_helpPage = new HelpPage();
            m_helpPage.ShowDialog();
        }

       helpToolStripMenuItem.Enabled = true;
    }

from this i can only see the Content page of common helpfile, but not the particular application help that is selected. Now i did run Appl1 but still i can see the main MyAppbut not Appl1that is automatically selected and the contents that is displayed to right.

the !st screen in the image is what i am getting now, but i need the second screen

I am using VS 2010,C#, win forms thanks in advance

leppie
  • 115,091
  • 17
  • 196
  • 297
roopini n
  • 503
  • 2
  • 7
  • 29

1 Answers1

0

I believe that your issue is that you are accessing the wrong value in the HelpNavigator enum. Looks like it should be Topic, not TableOfContents.

System.Windows.Forms.Help.ShowHelp(new System.Windows.Forms.Control(), 
                helpFilePath, System.Windows.Forms.HelpNavigator.Topic, "Appl2") ;

http://msdn.microsoft.com/en-us/library/system.windows.forms.helpnavigator.aspx

badpanda
  • 2,446
  • 5
  • 34
  • 45
  • @badpanda- i tried all possibilities, this doesn't even display the contents of MyApp. i need Appl1 in the first open of help file when i run Appl1. MyApp has Appl1 and Appl2. – roopini n Mar 15 '13 at 06:03
  • Ok...just to be clear. You have a help file 'MyApp' which has Table of Contents topics 'Appl1' and 'Appl2'. This help file is referenced from within two applications and you wish to simply display the relevant topics 'Appl1' and 'Appl2', correct? – badpanda Mar 15 '13 at 06:14
  • @badpanda- MyApp is the topic,Appl1 and Appl2 are the sub topics. – roopini n Mar 15 '13 at 09:11
  • Perhaps using ShowHelp(new System.Windows.Forms.Control(), helpFilePath, "Appl1"); would work better. – badpanda Mar 15 '13 at 16:41
  • @badpanda-no,its not working. From he image, if MyApp is expanded, i get Appl1 and Appl2. So i need Appl1 and Appl2 corresponding to the application i run. – roopini n Mar 18 '13 at 03:47