Quantcast
Viewing all articles
Browse latest Browse all 15621

KeyUp event on TextBox ?

Hi friends,

I try modifiy my program and I discovered a problem.

Code:

Private Sub serialnumber_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then KeyAscii = 0
If Len(serialnumber.Text) < 8 Then
serialnumber.BackColor = vbRed
Else
serialnumber.BackColor = vbWhite
End If
End Sub

It doesn't as I would like.
Because the TextBox value has not yet receveid the character I pressed when I count its length.

I would try with KeyUp event but I get a compilation error when I try to run the project.

Any idea ?
Thanks :)
Couin

Viewing all articles
Browse latest Browse all 15621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>