Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C#
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 22-Jan-11 0:17am
sk saini5.6K
Edited 22-Jan-11 20:18pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You can use the Help class[^]. This class provides a Showpopup window that you could use to display compiled files.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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?
  Permalink  
Comments
sk saini at 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 at 8-Apr-13 6:19am
   
can you plz detail me same code in java lang.if possible make it as fast as possible.....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can open a CHM file in a new window through two ways:
 
1. Process.Start("chm file path")
2. Using HelpProvider control.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 190
1 Jochen Arndt 155
2 PIEBALDconsult 150
3 Afzaal Ahmad Zeeshan 120
4 DamithSL 115
0 OriginalGriff 5,695
1 DamithSL 4,591
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 23 Jan 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100