[Help]Button1 not declared[Solved]
Anyone know a way to fix this?
Code:
Module Module1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Public Sub HotKey(ByVal hotkey As Boolean)
HotKey = GetAsyncKeyState(Keys.Insert) 'Change to any hotkey
If hotkey = True Then
Button1.Click()
'Do something
'add your code here when the hotkey is pressed
End If
End Sub
End Module
From this guide:
http://www.mpgh.net/forum/33-visual-...odule-new.htmlAdd A button to your form....
That's the problem with C&P and lacking the basic concept and understanding of the language you are attempting to work with.
When you add a button to the form it will assign it a name.
The first button you add will be called (by default) button1.
Now considering you are working with modules, you may need to add the form name first.
IE : Button1 won't be called button1 if it is on form1 it will be called
Form1.Button1
If it is on form2 it is
Form2.Button1
get it?..