PC Review


Reply
Thread Tools Rate Thread

Associate chm help file with F1 key

 
 
Doug
Guest
Posts: n/a
 
      23rd Jan 2007
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


 
Reply With Quote
 
 
 
 
Peter Macej
Guest
Posts: n/a
 
      23rd Jan 2007
> 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.Location 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
 
Reply With Quote
 
Doug
Guest
Posts: n/a
 
      23rd Jan 2007
Thanks Peter

how can i use

System.Reflection.Assembly.GetExecutingAssembly.Location to get the appPath.

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

Doug
"Peter Macej" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
>> 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.Location 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



 
Reply With Quote
 
JE
Guest
Posts: n/a
 
      23rd Jan 2007
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.Location to get the appPath.
>
> I tried string appPath=
> System.Reflection.Assembly.GetExecutingAssembly.Location; but I get an error
> for that code.
>
> Doug
> "Peter Macej" <(E-Mail Removed)> wrote in message
> news:O%(E-Mail Removed)...
>>> 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.Location 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

>
>

 
Reply With Quote
 
Peter Macej
Guest
Posts: n/a
 
      23rd Jan 2007
> I tried string appPath=
> System.Reflection.Assembly.GetExecutingAssembly.Location; 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
associate help file with F1 key Doug Microsoft C# .NET 1 8th May 2007 10:45 AM
Associate file extension with a batch file =?Utf-8?B?YmF0dGVyaWVzNGV2ZXI=?= Windows XP Customization 2 10th Oct 2006 06:30 AM
OE6 .eml file associate?? =?Utf-8?B?WmlnZ2ll?= Microsoft Windows 2000 1 5th Jun 2006 01:41 AM
Windows won't associate file? brett Windows XP General 14 14th Feb 2006 08:02 PM
How to de-associate a file type =?Utf-8?B?RGlkaQ==?= Microsoft Windows 2000 13 30th Sep 2005 08:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:08 PM.