Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,131 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,148 people online right now. Registration is fast and FREE... Join Now!




Linking a help file to a menu button

2 Pages V  1 2 >  
Reply to this topicStart new topic

Linking a help file to a menu button, How can I link a help file to a menu button?

DjVw321
10 Jul, 2008 - 03:58 PM
Post #1

New D.I.C Head
*

Joined: 25 Jun, 2008
Posts: 13


My Contributions
I have a help file that is in .chm format. I can get it to open using the helpprovider but at the moment that only works if the user presses the F1 button. This program is very simple so if the user actually needs help with it I don't think they are going to know enough to press F1 for help. How can I make it so that if they go under the help menu and click on help the chm file will open like it does with the helpprovider?
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: Linking A Help File To A Menu Button
10 Jul, 2008 - 04:50 PM
Post #2

LINQ D.I.C.
Group Icon

Joined: 29 May, 2008
Posts: 863



Thanked: 54 times
Dream Kudos: 2250
My Contributions
Is this vb6 / a VB.net version of basic.(eg an Express Edition)

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is offlineProfile CardPM
+Quote Post

Zhalix
RE: Linking A Help File To A Menu Button
10 Jul, 2008 - 04:53 PM
Post #3

D.I.C Head
**

Joined: 7 May, 2008
Posts: 218



Thanked: 9 times
My Contributions
The only way I know of is to use the ShellExecute API.

CODE

Private Declare Function ShellExecute Lib "Shell32" (hWnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
nShowCmd As Long) As Long


CODE

'Owner, Operation, File, Parameter, Directory, WindowStyle
ShellExecute Form1.hwnd, "open", "help.chm", "", App.Path, 1

User is offlineProfile CardPM
+Quote Post

DjVw321
RE: Linking A Help File To A Menu Button
11 Jul, 2008 - 05:22 AM
Post #4

New D.I.C Head
*

Joined: 25 Jun, 2008
Posts: 13


My Contributions
I am using Microsoft Visual Basic 2008 Express Edition. I am attaching the code as a file because for some reason whenever I try to post the code the post acts like I didn't type anything at all and wont let me post it.


Attached File(s)
Attached File  Code.txt ( 89.42k ) Number of downloads: 48
User is offlineProfile CardPM
+Quote Post

DjVw321
RE: Linking A Help File To A Menu Button
15 Jul, 2008 - 01:16 PM
Post #5

New D.I.C Head
*

Joined: 25 Jun, 2008
Posts: 13


My Contributions
QUOTE(Zhalix @ 10 Jul, 2008 - 05:53 PM) *

The only way I know of is to use the ShellExecute API.

CODE

Private Declare Function ShellExecute Lib "Shell32" (hWnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
nShowCmd As Long) As Long


CODE

'Owner, Operation, File, Parameter, Directory, WindowStyle
ShellExecute Form1.hwnd, "open", "help.chm", "", App.Path, 1



Thank you for letting me know what you would do but what exactly does that do? When I put it in vb 2008 it comes up with a bunch of errors. Could you explain what you are doing?
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: Linking A Help File To A Menu Button
15 Jul, 2008 - 04:25 PM
Post #6

LINQ D.I.C.
Group Icon

Joined: 29 May, 2008
Posts: 863



Thanked: 54 times
Dream Kudos: 2250
My Contributions
Have you tried addimg an HelpProvider object to the form
Set Namespace to help file location.

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Linking A Help File To A Menu Button
15 Jul, 2008 - 04:26 PM
Post #7

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Moved to VB.NET ( Visual Basic 2008 Express Edition is VB.NET) smile.gif
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: Linking A Help File To A Menu Button
15 Jul, 2008 - 05:35 PM
Post #8

LINQ D.I.C.
Group Icon

Joined: 29 May, 2008
Posts: 863



Thanked: 54 times
Dream Kudos: 2250
My Contributions
In the click event of the menu item add
vb

System.Windows.Forms.Help.ShowHelp(Me, <HelpFile>, HelpNavigator.TableOfContents)


User is offlineProfile CardPM
+Quote Post

DjVw321
RE: Linking A Help File To A Menu Button
17 Jul, 2008 - 04:04 PM
Post #9

New D.I.C Head
*

Joined: 25 Jun, 2008
Posts: 13


My Contributions
QUOTE(AdamSpeight2008 @ 15 Jul, 2008 - 05:25 PM) *

Have you tried addimg an HelpProvider object to the form
Set Namespace to help file location.


helpprovider only shows the help window when the user presses F1, i am trying to get it like any normal program where you go to the help menu and click the help button
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: Linking A Help File To A Menu Button
17 Jul, 2008 - 04:13 PM
Post #10

LINQ D.I.C.
Group Icon

Joined: 29 May, 2008
Posts: 863



Thanked: 54 times
Dream Kudos: 2250
My Contributions
QUOTE(DjVw321 @ 18 Jul, 2008 - 01:04 AM) *

QUOTE(AdamSpeight2008 @ 15 Jul, 2008 - 05:25 PM) *

Have you tried addimg an HelpProvider object to the form
Set Namespace to help file location.


helpprovider only shows the help window when the user presses F1, i am trying to get it like any normal program where you go to the help menu and click the help button

See my previous posting
User is offlineProfile CardPM
+Quote Post

DjVw321
RE: Linking A Help File To A Menu Button
18 Jul, 2008 - 09:42 AM
Post #11

New D.I.C Head
*

Joined: 25 Jun, 2008
Posts: 13


My Contributions
sorry didnt notice the other posting. How would the code you mentioned work? would it be using an html help file off of a website or a help file installed on the user's computer? Also, when i paste that code into the program it spits out a handful of errors but when i type it in by hand it turns out fine but the option that it gives between the < and > is, i think, for me to put in a web address that i would be getting the help file from. I have it all set up for me to use an actual file from the computer that would be installed with the program. If the internet is the only way to use this then i guess that i can set it up that way, but i would prefer not to seeing as i already have it made.
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: Linking A Help File To A Menu Button
18 Jul, 2008 - 10:08 AM
Post #12

LINQ D.I.C.
Group Icon

Joined: 29 May, 2008
Posts: 863



Thanked: 54 times
Dream Kudos: 2250
My Contributions
QUOTE(AdamSpeight2008 @ 16 Jul, 2008 - 02:35 AM) *

In the click event of the menu item add
vb

System.Windows.Forms.Help.ShowHelp(Me, <HelpFile>, HelpNavigator.TableOfContents)



Replace "<HelpFile>" with the file location of the help (ie where it is in the disc)
Example
vb

System.Windows.Forms.Help.ShowHelp(Me, "C:\ThisIsTheHelpFile.chm", HelpNavigator.TableOfContents)



This post has been edited by AdamSpeight2008: 18 Jul, 2008 - 11:34 AM
User is offlineProfile CardPM
+Quote Post

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 01:47AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month