Vb (hotkey) Help

Posts 1–14 of 14 · Page 1 of 1
Vb (hotkey) Help
When i try to make a hot key i get this error:


Compile Error:
Sub Or Function not Defined

I put this code in timer at interval 1:

Code:
Private Sub Timer1_Timer()
If GetKeyPress(vbKeyAButton) Then
Shape1.BackColor = &HFF&
End Sub
HELP ME PLZ
help meeeeeeeeeeeeeeeeeeeeee
Stop spamming.. -.-
Well This is useless then noe helps me
Quote Originally Posted by redarr View Post
When i try to make a hot key i get this error:


Compile Error:
Sub Or Function not Defined

I put this code in timer at interval 1:

Code:
Private Sub Timer1_Timer()
If GetKeyPress(vbKeyAButton) Then
Shape1.BackColor = &HFF&
End Sub
try this way -----put interval to "100"

Code:
If GetKeyPress(vbKeyControl) And GetKeyPress(vbKeyD) Then
Command1_Click
End If
OMFG... It WONT WORK I h8 my Self Same Prob
Quote Originally Posted by redarr View Post
OMFG... It WONT WORK I h8 my Self Same Prob
What doesn't work?!, and don't me emo, thats my job -_-.
OMG lol vbKeyAButton doesnt exist use vbKeyA
I have this problem too help
Make sure your timer interval is 1 and use this code:
Code:
Private Sub Timer1_Timer()
If GetKeyPress(vbKeyA) Then
Shape1.BackColor = &HFF&
End If
End Sub
Quote Originally Posted by suticox View Post
OMG lol vbKeyAButton doesnt exist use vbKeyA
then use this way
Code:
If GetKeyPress(vbKeyControl) Then
 and put u r call write here
lol, have u declared the API?

If not on top of the code:
private declare function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
LOL YOU KIDDING ME?
it should be:
Code:
If GetKeyPress(vbKeyA) then
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us