|
-
Oct 3rd, 2000, 01:49 PM
#1
Thread Starter
Fanatic Member
I have a Help and Instuctions file created in Notepad for my app. How do I make it accessible from my mnuHelp_Click() event? When I distribute my app how do I make the notepad file go with it?
Thanks for any help with this!
JO
-
Oct 3rd, 2000, 02:02 PM
#2
Fanatic Member
You can have the helpfile ShellExecuted.
Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub mnuHelp_Click()
ShellExecute(app.path "\help.txt")
End Sub
And to distribute it you can simply package it with P&DW that is shipped with VB. Simply look through the start menu for it. When packaging it will ask if you would like to add any files...you can select the help file then.
Gl,
D!m
-
Oct 3rd, 2000, 02:02 PM
#3
You could set the Shortcut in the Menu Editor for F1 and put this code in it:
Code:
Private Sub mnuHelp_Click()
Shell "Notepad.exe " & App.Path & "\myhelpfile.txt", vbNormalFocus
End Sub
You can also set your Form's KeyPreview property to True and add this:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF1 'F1 pressed
Shell "Notepad.exe " & App.Path & "\myhelpfile.txt", vbNormalFocus
'Loads your txt file with notepad
'txt file is located in your exe's directory
End Select
End Sub
Both will work.
-
Oct 3rd, 2000, 02:58 PM
#4
Thread Starter
Fanatic Member
They all work, Thanks to both of you.
But what if I don't know the directory the user will choose?
-
Oct 3rd, 2000, 03:27 PM
#5
Assuming your help file will be in the exe's directory, you can use App.Path to determine the exe's directory.
Put this in a form and see for yourself:
Code:
Private Sub Form_Load()
Msgbox App.Path
End Sub
You should know where the help file will be placed.
-
Oct 9th, 2000, 03:51 PM
#6
Thread Starter
Fanatic Member
Forgot to say thanks!!!!
I got it going!
JO
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|