goosen的方法可以使你的程序在接收到F1键时打开你的帮助文档。即使是chm格式的也可以。 如果你想利用一个按钮来实现的话可以这样: 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 Const SW_SHOWNORMAL = 1Private Sub Command1_Click() ShellExecute Me.hwnd, vbNullString, 帮助文档文件名称 , vbNullString, app.path, SW_SHOWNORMAL End Sub
如果你想利用一个按钮来实现的话可以这样:
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
Const SW_SHOWNORMAL = 1Private Sub Command1_Click()
ShellExecute Me.hwnd, vbNullString, 帮助文档文件名称 , vbNullString, app.path, SW_SHOWNORMAL
End Sub