将鼠标放在想进一步详细信息的项目上,单击右键,然后在所显示的上下文菜单中选择这是什么命令。
操作系统提供在 Windows 95 帮助弹出中显示的文本。也可以通过设置 Flags 属性,在带有 CommonDialog 控件的对话框中显示一个帮助按钮,但是,必须在这个位置提供帮助主题。
注意 无法指定对话框显示在什么地方。
在给你一点我的烂代码
呵呵!~~~
Dim sFilter As String
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
Text1(23).Text = CommonDialog1.FileName
Image1.Picture = LoadPicture(CommonDialog1.FileName)
Const winCommand=100 ’常量设置
Const winText=200
Sub Form—Load()
App.HelpFile="DY.HLP"
Command1.HelpContextID=winCommand
Text1.HelpContextID=winText '帮助文件的名字,在当前目录下
End Sub
如果用此种方式,那么上例中程序变化如下:
Const KEY F1=&H70
Sub Form_Load()
CommonDialog1.HelpCommand=vbHelpContext
CommonDialog1.HelpFile="DY.HLP"
End Sub
Sub Command1_KeyDown(KeyCode As Integer,Shift As Integer)
If KeyCode=KEY_F1 Then
CommonDialog1.HelpContext=100
CommonDialog1.Action=6
End If
End Sub
Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer)
If KeyCode=KEY_F1 Then
CommonDialog1.HelpContext=200
CommonDialog1.Action=6
End If
End Sub
也可以利用关键字来指定帮助信息,则程序修改如下:
Const KEY_F1=&H70
Sub Form_Load()
CommonDialog1.HelpCommand=vbHelpKey
CommonDialog1.HelpFile="DY.HLP"
End Sub
Sub Command1_KeyDown(KeyCode As Integer,Shift As Integer)
If KeyCode=KEY—F1 Then
CommonDialog1.HelpKey="Command"
CommonDialog1.Action=6
End If
End Sub
Sub Text1—KeyDown(KeyCode As Integer,Shift As Integer)
If KeyCode=KEY_F1 Then
CommonDialog1.HelpKey="Text"
CommonDialog1.Action=6
End If
End Sub