【问题标题】:How to make hotkeys in VB6?如何在VB6中制作热键?
【发布时间】:2016-10-09 12:02:54
【问题描述】:

我有一些问题,我打算让一个表单可以隐藏自己并且表单可以再次显示(只能使用热键激活它)。我的问题的源代码是什么?

【问题讨论】:

  • 使用RegisterHotKey API。

标签: vb6 hotkeys


【解决方案1】:

用这个声明

Dim i As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As     Integer

然后做一个计时器

Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyControl) And GetAsyncKeyState(vbKeyR) Then
Frmsav.Show
End If
End Sub

该代码使用 Ctrl + R 显示您的表单

【讨论】:

    猜你喜欢
    • 2014-08-23
    • 2010-12-31
    • 1970-01-01
    • 2010-11-19
    • 1970-01-01
    • 2014-01-02
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多