How to open a particular page in chm file using c# WPF

User123 picture User123 · Apr 18, 2012 · Viewed 7.1k times · Source

I want to Open the particular page of CHM file. I am using WPF application. Currently i have implemented the

System.Diagnostics.Process.Start(filepath)

This will not help open the particular page

Regards, NewDev

Answer

David picture David · Apr 18, 2012

It sounds like you're essentially trying to add context-sensitive help to a WPF application. For example, that if you hit F1 with your cursor in a specific textbox, you'll see help for that specific textbox.

If that's the case, see this article:

http://blogs.msdn.com/b/mikehillberg/archive/2007/07/26/a-context-sensitive-help-provider-in-wpf.aspx

or this one:

http://www.netframeworkdev.com/windows-presentation-foundation-wpf/contextsensitive-help-in-wpf-73953.shtml

Specifically, you can accomplish this using the System.Windows.Forms.Help.ShowHelp() command.

You may need to add a reference to System.Windows.Forms.dll to access the Help functions.

Finally, if you're still lost on using Help files, all the info you need should be right here: http://msdn.microsoft.com/en-us/library/2ksk25ts.aspx This is all for Windows Forms, of course, but it should carry over to WPF if you have the correct references.