Hello everyone..
Let me tell where i am in my programming..
I have 3 command buttons in my form. say a, b,c
When I press the Key A in keyboard, I need the color of my command buton A to change. Similarly for If I press the keys B and C, I need the corresponding commandbuttons to change in color.
I am using the following code but I am not able to get the result.
Private Sub Command1_KeyPress(KeyAscii As Integer)
Call Form_KeyPress(KeyAscii)
End Sub
Private Sub Command2_KeyPress(KeyAscii As Integer)
Call Form_KeyPress(KeyAscii)
End Sub
Private Sub Command3_KeyPress(KeyAscii As Integer)
Call Form_KeyPress(KeyAscii)
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 65
Command1.BackColor = QBColor(Rnd * 15)
Case 66
Command2.BackColor = QBColor(Rnd * 15)
Case 67
Command3.BackColor = QBColor(Rnd * 15)
End Select
end sub
I think I am missing something somewhere.. Can anyone please help for this thread..