How to set the selected item as a tree in the left part of the CHM file

I have a CHM help file for my WPF application. My CHM file contains "htm" files for each page of my application. I want to open the help file for the corresponding page when the user presses F1 on this page. Now I can find the page and open this page using the following code:

Help.ShowHelp(this, helpfile, keywordText); 

where keywordText contains the url of my htm file for the selected page.

But the problem is that the panel on the left (the content tab in the tree view) does not expand on the page opened in the right window. The panel on the left side always remains unchanged.

How can I extend the tree structure on the left to the selected page?

+7
source share
2 answers

Look at the code and a small graphical interface (tied). Themes are updated after clicking the "Users" button (for example, Help Topic1).

Please note that a help file created using Microsoft HTMLHelp Workshop may require an automatic synchronization option.

 private void btnHelpTopic1_Click(object sender, EventArgs e) { // sHTMLHelpFileName_ShowWithNavigationPane = "CHM-example_ShowWithNavigationPane.chm" // This is a HelpViewer Window with navigation pane for show case only // created with Microsoft HTMLHelp Workshop helpProvider1.HelpNamespace = Application.StartupPath + @"\" + sHTMLHelpFileName_ShowWithNavigationPane; Help.ShowHelp(this, helpProvider1.HelpNamespace, @"/Garden/tree.htm"); } private void btnHelpTopic2_Click(object sender, EventArgs e) { helpProvider1.HelpNamespace = Application.StartupPath + @"\" + sHTMLHelpFileName_ShowWithNavigationPane; Help.ShowHelp(this, helpProvider1.HelpNamespace, @"/Garden/flowers.htm"); } 

enter image description here

For download, I provide the C # VS2008 Project , including the code above and help files with different help view windows (different CHM files for display only).

+3
source

Thanks.

The problem is in the url.

Before that I gave a URL like this

"help.chm :: / html / MyHelp.htm"

And when I removed "Help.CHM :: /" from the url and everything worked well.

+1
source

All Articles