473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Associate chm help file with F1 key

Hi

I have my applicaiton ready to roll - and a help file compiled that I can
bring up with a help menu item. But how can I make the help file apear when
I press the F1 key?

The menu item event uses:
private void helpaHelpToolStripMenuItem_Click(object sender, EventArgs e)

{

Help.ShowHelp(this,helpfile);

}

Thanks

Doug
Jan 23 '07 #1
4 11368
bring up with a help menu item. But how can I make the help file apear when
I press the F1 key?
First you need to place HelpProvider component on your form from the
toolbox.

Then you need to set two properties on each control for which you want
F1 help:
1. HelpKeyword property to HTML file name of the topic to be opened in
your compiled CHM file, e.g. myTopic.htm
2. HelpNavigator property to "Topic".

Don't forget to specify the absolute full path to the CHM file on
program startup. Note that the system doesn't look in application's
folder. Use something like:
HelpProvider1.HelpNamespace = IO.Path.Combine(appPath, "myHelpFile.chm");

and use System.Reflection.Assembly.GetExecutingAssembly.Lo cation to get
appPath.

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB
..NET and ASP .NET code
Jan 23 '07 #2
Thanks Peter

how can i use

System.Reflection.Assembly.GetExecutingAssembly.Lo cation to get the appPath.

I tried string appPath=
System.Reflection.Assembly.GetExecutingAssembly.Lo cation; but I get an error
for that code.

Doug
"Peter Macej" <pe***@helixoft.comwrote in message
news:O%****************@TK2MSFTNGP02.phx.gbl...
>bring up with a help menu item. But how can I make the help file apear
when I press the F1 key?

First you need to place HelpProvider component on your form from the
toolbox.

Then you need to set two properties on each control for which you want F1
help:
1. HelpKeyword property to HTML file name of the topic to be opened in
your compiled CHM file, e.g. myTopic.htm
2. HelpNavigator property to "Topic".

Don't forget to specify the absolute full path to the CHM file on
program startup. Note that the system doesn't look in application's
folder. Use something like:
HelpProvider1.HelpNamespace = IO.Path.Combine(appPath, "myHelpFile.chm");

and use System.Reflection.Assembly.GetExecutingAssembly.Lo cation to get
appPath.

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB .NET
and ASP .NET code

Jan 23 '07 #3
JE
string directory =
System.IO.Path.GetDirectoryName(System.Reflection. Assembly.GetExecutingAssembly().GetName().CodeBase );

Remember the path will look like this: "file:\c:\path\path", so you will
have to remove the "file:\".
Doug wrote:
Thanks Peter

how can i use

System.Reflection.Assembly.GetExecutingAssembly.Lo cation to get the appPath.

I tried string appPath=
System.Reflection.Assembly.GetExecutingAssembly.Lo cation; but I get an error
for that code.

Doug
"Peter Macej" <pe***@helixoft.comwrote in message
news:O%****************@TK2MSFTNGP02.phx.gbl...
>>bring up with a help menu item. But how can I make the help file apear
when I press the F1 key?
First you need to place HelpProvider component on your form from the
toolbox.

Then you need to set two properties on each control for which you want F1
help:
1. HelpKeyword property to HTML file name of the topic to be opened in
your compiled CHM file, e.g. myTopic.htm
2. HelpNavigator property to "Topic".

Don't forget to specify the absolute full path to the CHM file on
program startup. Note that the system doesn't look in application's
folder. Use something like:
HelpProvider1.HelpNamespace = IO.Path.Combine(appPath, "myHelpFile.chm");

and use System.Reflection.Assembly.GetExecutingAssembly.Lo cation to get
appPath.

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB .NET
and ASP .NET code

Jan 23 '07 #4
I tried string appPath=
System.Reflection.Assembly.GetExecutingAssembly.Lo cation; but I get an error
for that code.
You probably need to add parentheses after GetExecutingAssembly as it is
a method. I forgot to add them.
System.Reflection.Assembly.GetExecutingAssembly(). Location

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB
..NET and ASP .NET code
Jan 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: knutsample | last post by:
Hello! I'm trying to associate a file extension to my wxPython script so that all I have to do is double click on the file and my python script will load up with the path of that file. For...
6
by: Ashok | last post by:
hi, i want to know how to make a specific type of file open in an application i developed in python when the user clicks on the file.(in windows) for eg. a .txt file when clicked opens in notepad,...
8
by: Chandrashekar Tippur | last post by:
All, We want to associate a argument with a corresponding entry in header file. How do we do this? The argument is defined in a header file. We want to extract the value of the #define...
2
by: Angel | last post by:
How do I associate a server side command button to a Javascript function that is in the Web Form HTML Code? Thanks
1
by: Brian Kitt | last post by:
Over the years, from time to time, I've added a website as a 'favorite', and noticed that an icon (other than the standard ie icon) would be associated with it. Unfortunatley I don't have any of...
1
by: dab | last post by:
I want to make a file associate with my program I just created. I'd like text files to open up my app instead but I don't know where to begin. I found a C# example, but am having a hard time...
4
by: BD | last post by:
Hi all. Running SQL2K SP4 on W2K3 Standard, SP4. I have just refreshed a database on one server with a backup from another. The database had existed previously on the target server, and I am...
1
by: Doug | last post by:
Hi i have an app that i am writing and i have a help file that is called by the help menu. I would like to associate this help file with the F1 key but when i use the following code, i dont get...
6
by: Reggie | last post by:
am trying to associate username with filename in a upload script. I get this error: Parse error: syntax error, unexpected T_STRING in /home/fhlinux169/c/ clashoff.co.uk/user/htdocs/upload.php...
0
by: liuhengyi | last post by:
Hi, I also have a question when using VS 2008 to edit the xml file. In my xml file, I used schemaLocation attribute to specify the xsd. If I put the xsd in our internal sharepoint site such as:...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.