我用HTML Help Workshop做好了帮助,怎么实现在程序中按F1转到相应主题的功能?我试验了半天也不行
参考:
http://bbs4.xilubbs.com/cgi-bin/bbs/view?forum=fspace&message=738

解决方案 »

  1.   

    If KeyCode = 112 Then '按下F1
    ……
    End If
      

  2.   

    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 LongPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    On Error GoTo Errhandle
        If KeyCode = vbKeyF1 Then
            ShellExecute Me.hwnd, "open", "C:\aa.hlp", vbNullString, vbNullString, 1
        End If
        
        Exit Sub
    Errhandle:
        MsgBox Err.Description & "!", vbInformation
    End SubPrivate Sub Form_Load()
        Me.KeyPreview = True
    End Sub