Posted: Sun Aug 15, 2010 6:50 pm Post subject: How do I Add Hot Keys To VB 2005/2008/2010
I am currently making an awesome trainer but i ran into this issue i couldnt figure out how to add hot-keys
I have vb 2010
+rep if gaven the right code
PLZ HELP!!!!!!!!!!!!!!!!!! _________________
Or you can install a keyboard hook, but that seems too advanced for you, here is an example for you (I haven't coded in VB.NET in a while, so there may be some small syntax errors):
Code:
Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal Key As Long) As Integer
Add that to the top of your code, then in your button or whatever, add this code (If the user presses the control key, alias is CTRL):
Code:
If GetAsyncKeyState(17) Then
MsgBox("Hi")
End If
This should work each time you hit your button or whatever, or you can put it in a timer.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum