Thread View: be.comp.programming
2 messages
2 total messages
Started by MdV
Sat, 12 Mar 2005 10:09
VB6
Author: MdV
Date: Sat, 12 Mar 2005 10:09
Date: Sat, 12 Mar 2005 10:09
5 lines
1165 bytes
1165 bytes
VB6 vraagje : Hoe kan ik in een bepaald textveld de invoer verplichten om cijfers in te geven en dan in een ander textveld letters of gemengd ?
Re: VB6
Author: Sinna
Date: Mon, 14 Mar 2005 10:19
Date: Mon, 14 Mar 2005 10:19
28 lines
1556 bytes
1556 bytes
MdV wrote:
> VB6 vraagje :
>
> Hoe kan ik in een bepaald textveld de invoer verplichten om cijfers in te
> geven en dan in een ander
> textveld letters of gemengd ?
>
>
In de KeyPress event alles buitengooien wat niet mag, bv.
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 32 Then
If KeyAscii < 48 Or KeyAscii > 57 Then
'48 = Asc("0"), 57 = Asc("9")
'Key not allowed: eat it
KeyAscii = 0
End If
'Else
' Don't interprete control keys
End If
End Sub
In woorden: gooi voor alle niet-controle-karakters alles weg wat niet in
het interval 0-9 valt.
Eventueel kan je nog een beep-commando geven voor je KeyAscii = 0
Sinna
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads