benbants
benbants

Reputation: 608

C# - How to display a help file with help provider?

I'm experimenting with help files and help-providers.

My issue is I cannot display the help file without conflicting with other help-provider code.

helpProvider1.SetShowHelp(btnFont, true);
helpProvider1.SetHelpString(btnFont, "Change the font.");

helpProvider1.HelpNamespace = "helpfile.chm";

The HelpNamespace property takes precedence over the SetHelpString method, but I still want to display these help strings.

Is the only option to use another hotkey?

Upvotes: 3

Views: 6829

Answers (1)

help-info.de
help-info.de

Reputation: 7260

Windows Forms supports "What's this .." help on individual controls (Pop-up Help). The HELP button makes sense on dialog boxes, because modal dialog boxes need to be closed before focus can go to another window. I think it's not a problem for you to translate the following samples from VB to C# (some old stuff but HTH). All this has a learn curve of course.

See Creating Pop-up Help for Visual Basic .NET controls

Please note: The Windows Forms HelpProvider component is used to associate HTML Help files (HTMLHelp 1.x, Help 2.x or single HTML file) with your Windows application. The HelpString property can be used to show Pop-Up Help but you must set the HelpNamespace property of hlpProvider1 (see HTML Help). If there is no filename and the user hits F1 the application runs to an error.

For further information see also Compiled HTML Help file shows "This program cannot display...", when pressing F1 on the debugged application.

Upvotes: 2

Related Questions