首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

VB 定义大局(热键)快捷键

2012-09-27 
VB 定义全局(热键)快捷键(ByVal vKey As Long) As Integer 声明Function GetKey() As StringDim AddKey A

VB 定义全局(热键)快捷键

(ByVal vKey As Long) As Integer '声明

Function GetKey() As String
Dim AddKey As String
KeyResult = GetAsyncKeyState(32) '回车键
If KeyResult = -32767 Then
AddKey = "[ENTER]"
GoTo KeyFound
End If

KeyFound
'显示键的信息
If AddKey = "" Then
Exit Function
Else
GetKey = AddKey
'-------------------------
End If
End Function

Private Sub Timer1_Timer() '显示按键
Static a As String
a = GetKey
If a <> "" Then Label1.Caption = a
End Sub

?

热点排行