🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #1466

Re: VB6

#1466
From: Sinna
Date: Mon, 14 Mar 2005 10:19
28 lines
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
Technical Details
Message-ID: <39l6tqF63lt09U1@individual.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <QdzYd.35794$cl5.3349595@phobos.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,6305baab893e585a
X-Google-Attributes: gidfcea4,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Sinna <news4sinna_NOSPAM@hotpop.com>
Newsgroups: be.comp.programming
Subject: Re: VB6
Date: Mon, 14 Mar 2005 11:19:07 +0100
Lines: 28
Message-ID: <39l6tqF63lt09U1@individual.net>
References: <QdzYd.35794$cl5.3349595@phobos.telenet-ops.be>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net eKWxrez1SYjJeY3VM8cdWg8RB6F5hBI5q/pg314Z7XJ4S/LIl9
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
In-Reply-To: <QdzYd.35794$cl5.3349595@phobos.telenet-ops.be>