Integrating with CHM File

  • Thread starter Thread starter O.B.
  • Start date Start date
O

O.B.

I have added a HelpProvider to my GUI. And I have been able to
successfully load the file using the following code:

protected override bool ProcessDialogKey(Keys keyData)
{
bool rv = false;
if (keyData == Keys.F1)
{
Help.ShowHelp(
this,
helpProvider.HelpNamespace);
rv = true;
}
return rv;
}

However, I'd like for the Help to open to specific topic. I am using
a program called Word-2-CHM (by MacroObject) to convert Word files to
CHM files. And it does a great job. It provides me with a .cs file
that contains a bunch of enums for each of the .htm files within the
CHM file. So for example, one enum is "HID_Playbox = 1041" where the
associated help file is "1041.htm" within the CHM file. How does the
Help.ShowHelp() operation support the ability to show this specific
location?
 
Oh never mind ... figured it out by trial and error:

protected override bool ProcessDialogKey(Keys keyData)
{
bool rv = false;
if (keyData == Keys.F1)
{
Help.ShowHelp(this,
helpProvider.HelpNamespace,
HelpNavigator.Topic,
(int)HelpIdDefines.HID_Playbox + ".htm");
rv = true;
}
return rv;
}
 
Hi funkjunk

It can be simple by the HelpRequested event

private void Radiospeler_HelpRequested(object sender, HelpEventArgs
hlpevent)
{
Help.ShowHelp(this, "Radio speler.chm");
}

rinaldo
 
Back
Top