Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am building a application. I have a chm file located in Debug folder. I want to display it in the same windows with my Form.

Can you explain how to do that? I use web browser to open it but it opened in another windows.

Thanks!
Posted
Comments
Adam Zgagacz 29-Dec-13 20:25pm    
There are several CP articles about the subject. Perhaps you can start from there:

http://www.codeproject.com/Articles/187171/C-WinForms-Application-Full-Integration-with-HTMLH

http://www.codeproject.com/Articles/6765/HtmlHelp-library-and-example-viewer

http://www.codeproject.com/Questions/280791/how-to-create-chm-help-file-in-csharp-windows-appl

1 solution

In Windows Forms the Help Class Library in System.Windows.Forms provides the 'ShowHelp method which makes it easy to display a .chm file in [1] the ContainerControl/Form of your choice:
C#
private void btnShowCHMFile_Click(object sender, EventArgs e)
{
    Help.ShowHelp(pnlCHMHost, @"file:C:\Program Files (x86)\Internet Download Manager\scheduler.chm");
}
This is working code that will open the specified .chm file in [1] a specified Panel.

Reference: [^].

[1]Well, it doesn't really open the .chm file "in" a container control as you might expect in Windows Forms: it doesn't add a Control to the ControlsCollection of its specified target container, and it doesn't give you any valid reference to the chm viewer's window so that you could re-size it, etc. It creates a full-fledged Window, which is movable, and can be moved outside the boundaries of its specified 'Parent container without being clipped.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900