Hi,
can I first apologise as I'm new vb and not sure of all the terminology yet, I've been looking for the answer to this for a bit but have virtually given up and really hope you can help me out.
Basically i have lots of buttons labelled key1, key2 , key3 etc I want to try and use a for next loop to save me masses of code but i don't know how to get it to accept the button name with a variable number in it.
I hope this makes sense, here's my code segment that keeps failing.
Dim asci As Integer
Dim key(asci) As Control
For asci = 1 To 225
If (GetAsyncKeyState(asci)) Then
key(asci).BackColor = Color.Purple
End If
Next
can I first apologise as I'm new vb and not sure of all the terminology yet, I've been looking for the answer to this for a bit but have virtually given up and really hope you can help me out.
Basically i have lots of buttons labelled key1, key2 , key3 etc I want to try and use a for next loop to save me masses of code but i don't know how to get it to accept the button name with a variable number in it.
I hope this makes sense, here's my code segment that keeps failing.
Dim asci As Integer
Dim key(asci) As Control
For asci = 1 To 225
If (GetAsyncKeyState(asci)) Then
key(asci).BackColor = Color.Purple
End If
Next