vb按alt+s显示标签内容 在线等
发布网友
发布时间:2024-04-13 21:38
我来回答
共2个回答
热心网友
时间:2024-04-14 00:46
新建一个名叫Timer1的计时器,interval设为10,然后在相应位置添加如下代码
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Dim altKey, sKey
Private Sub Form_Load()
altKey = False
sKey = False
End Sub
Private Sub Timer1_Timer()
a = GetKeyState(18)
b = GetKeyState(vbKeyS)
If a = -127 Or a = -128 Then
altKey = True
Else
altKey = False
End If
If b = -127 Or b = -128 Then
If altKey = True And sKey = False Then
MsgBox "在此输入显示标签代码"
End If
sKey = True
Else
sKey = False
End If
End Sub
热心网友
时间:2024-04-14 00:46
Call keybd_event(17, 0, 0, 0) '模拟ctrl 按下
Call keybd_event(17, 0, &H2, 0) '模拟ctrl弹起
Shift 16
Control 17
Alt 18
全选文本不如直接添加个按钮
Private Sub Command1_Click()
Text1.SetFocus搜索
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub