How i can protext text box which i use for showing const of writing numbers and leters t.e char
How to protect text box for writing of number and characters VB6
Collapse
X
-
Originally posted by JolaceHow i can protext text box which i use for showing const of writing numbers and leters t.e char -
Originally posted by Jolacecan you help me with the code? it txt3.text when i submit results
Code:Private Sub Text1_KeyPress(KeyAscii As Integer) KeyAscii = validateonlunum(KeyAscii) End Sub Private Function validateonlunum(ByRef keyas As Integer) Dim Validstr$ sValidstr = "0123456789" If InStr(sValidstr, Chr(keyas)) = 0 Then validateonlunum = 0 Else validateonlunum = keyas End Function
Comment
-
[QUOTE=vijaydiwa kar]this code may help u
[CODE]
Private Sub Text1_KeyPress( KeyAscii As Integer)
KeyAscii = validateonlunum (KeyAscii)
End Sub
When i write:
Private Function validateonlunum (ByRef keyas As Integer)
Dim Validstr$
sValidstr = "0123456789 "
If InStr(sValidstr , Chr(keyas)) = 0 Then validateonlunum = 0 Else validateonlunum = keyas
End Function
Show me message: only comments may be appear after end sub end fuction.... well i can ask you for more help?Comment
-
see its a perfect sol try it
Code:Private Sub Text1_KeyPress(KeyAscii As Integer) KeyAscii = validateonlunum(KeyAscii) End Sub Private Function validateonlunum(ByRef keyas As Integer) Dim sValidstr$ sValidstr = "0123456789" If InStr(sValidstr, Chr(keyas)) = 0 Then validateonlunum = 0 Else validateonlunum = keyas End Function
Comment
Comment