How to put hotkey in visual basic with screen shots !
Posts 1–3 of 3 · Page 1 of 1
How to put hotkey in visual basic with screen shots !
Hello !
How to make a visual basic hotkey with a timer and some screen shots ..etc !!
It's an easy tutorial but we want to test it first before use it on your own project for no get errors and no destroy your project if you did some wrong thing in coding ....
1-Open visual basic [ No need screen shots ]
2-New project and name it any name u want [ No need screen shots ]
3-Add 1 button and 1 timer [ No need screen shots ]
3-name the button ''test [ No need screen shots ]
5-Go to timer properties and make timer enabled = True :
6-Go to Form1 and ''Public class form1'' and below that code put this code :
Code:
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function GetAsyncKeyState(ByVal vkey As System.Windows.Forms.Keys) As Short
End Function
6-Go and code button !! and write :
Code:
MsgBox("Hotkey working !!")
[for if the hotkey worked you will know !]
7-Go and code timer !! and write :
Code:
Dim hotkey As Boolean
hotkey = GetAsyncKeyState(Keys.KeyName)
If hotkey = True Then
ButtonNumber.PerformClick()
End If
All code :
All Form :
Hope this tutorial help you !!