Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to use my .chm file as help for my Windows application software and want to display it within a Form.
Can we embed our CHM File in a container control in visual studio 2005 window project.
If yes, which control and how?
Posted
Updated 22-Jan-11 19:18pm
v2

You can use the Help class[^]. This class provides a Showpopup window that you could use to display compiled files.
 
Share this answer
 
A CHM file is a compiled HTML file - you probably know that - and is opened by the Help application. Normal browser controls will not open them for security reasons (they can contain code and run on the client machine).

It would be unusual to embed a CHM file in a tab, and I'm not sure it is possible without processing the file content yourself. Is there a good reason for wanting to do this specifically, or are you trying to solve a more general problem?
 
Share this answer
 
Comments
sk saini 22-Jan-11 5:40am    
I have made CHM file from a Word file through a converter. I want to use it in my windows application. If its not possible to open it in tab page then can we open it in a windows form. If yes, How?
raj100mac 8-Apr-13 6:19am    
can you plz detail me same code in java lang.if possible make it as fast as possible.....
You can open a CHM file in a new window through two ways:

1. Process.Start("chm file path")
2. Using HelpProvider control.
 
Share this answer
 
Hi,

To use a CHM as a help source for your application you can use the webbrowser control. You need to pass the correct url to the webbrowser control.

webBrowser.Navigate(@"mk:@MSITStore:C:\HelpFiles\Help.chm::/Index.htm");


You could wrap that up in a class to make it easer to use. For example, filename is the full path to your CHM file, page is the name of the page inside the CHM, for example Index.Htm
C#
public static string GetChmUrl(string fileName, string page)
{
    StringBuilder url = new StringBuilder();
    url.AppendFormat("mk:@MSITStore:{0}::", fileName);
    if(page.IndexOf('/') != 0) url.Append('/');
    url.Append(page);
    return url.ToString();
}


and to pass it to your webbrowser:
webBrowser.Navigate(new Uri(GetChmUrl(mFileName, page)));


You can read these articles about help system in C#
Context Help Made Easy[^]

good luck

Valery.
 
Share this answer
 

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