Share via

HELP IN MESSAGE BOX

Giorgio Sfiligoi 656 Reputation points
2021-01-10T08:45:18.67+00:00

I created a small TestHelp program consisting of a MainFrame with a button MB that pops up a MessageBox:

    private void buttonMB_Click(object sender, EventArgs e)
    {
        MessageBox.Show(
            null,       // omitting this parameter makes no difference
            "Message", "Caption",
            MessageBoxButtons.OK, MessageBoxIcon.Information,
            MessageBoxDefaultButton.Button1, 0,
            helpFile,
            HelpNavigator.KeywordIndex, "mb_test.htm");
            //HelpNavigator.Topic, "mb_test.htm");  // makes no difference
    }

With HTMLHelpWorkshop I created a help file that contains the topics "main_frame.htm" and "mb_test.htm". I can see both topics in the Contents of the help file.

Pressing the 'Help' button in the MessageBox does not show the page "mb_test" as expected, but the page "main_frame" instead. As you can see in the comment, using HelpNavigator.Topic makes no difference.

What am I doing wrong?

Developer technologies | Windows Forms
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Castorix31 91,876 Reputation points
    2021-01-10T13:57:39.887+00:00

    If I test with a .CHM from MS SDK, like SHELLCC.CHM (there is a copy here for example (with SHELLCC.CHI for index), that I copied in E:\Program Files\Doc), by using the right path, this works for me :

    (path given from .CHM = mk:@MSITStore:E:\Program%20Files\Doc\SHELLCC.CHM::/inet401/help/itt/CommCtls/ListView/ListView.htm#ch_listview)

      MessageBox.Show(null,
                        "Message", "Caption",
                        MessageBoxButtons.OK, MessageBoxIcon.Information,
                        MessageBoxDefaultButton.Button1, 0,
                        @"E:\Program Files\Doc\SHELLCC.CHM",
                        HelpNavigator.Topic, "/inet401/help/itt/CommCtls/ListView/ListView.htm");
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.