hi how can i change the backcolor of my label

the SA is the name of the label heres my code

Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 97
SA_Click (0)
Case 115
SA_Click (1)
Case 100
SA_Click (2)
Case 102
SA_Click (3)
Case 103
SA_Click (4)
Case 104
SA_Click (5)
Case 106
SA_Click (6)
Case 107
SA_Click (7)
Case 97
SA_Click (8)
Case 119
SA_Click (9)
Case 101
SA_Click (10)
Case 114
SA_Click (11)
Case 116
SA_Click (12)
Case 121
SA_Click (13)
Case 117
SA_Click (14)
Case 105
SA_Click (15)
Case 111
SA_Click (16)
End Select
End Sub

everytime i click they keyascii letter a the sa_click(0) should change the backcolor and then back to normal how can i do that?

Recommended Answers

All 4 Replies

Are you getting any error in your code ? that should work for you.

i have no error sir all i want is this

if i click keyascii 97 = a the SA_CLICK should click and the color of that label should change and then back to normal how can i do that?

You'll want to put the code to change the label (labelname.backcolor = vbred) color in mousedown or keydown, and then change it back to whatever it was previously on mouseup or keyup. You may need to use a variable of some kind (public to the form) to hold the default (or last used) color of the label (before you changed it on keydown)

where i can put that code? can u give me example?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.