🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #960

Re: Aiuto su limitazione scrittura in VB

#960
From: Ciccio
Date: Fri, 28 Jan 2005 17:02
36 lines
2349 bytes
Non īŋŊ una gran soluzione ma non puoi controllare che il numero immesso 
contenga o nīŋŊ la virgola e se non la contiene la metti tu a forza con 
due zeri dopo?
Ovviamente qui ci metti:
If ( (TASTO < "0" Or TASTO > "9")And(TASTO <> ".")And(TASTO <> ",") )

MrDigital ex WebMasterPro ha scritto:
> Salve volevo scrivere in un casella di testo solo numeri con la virgola per
> fare conti in euro cercando di introdurre un messaggio in caso non si
> introducano numeri o virgola
> Ma il codice qui sotto va tutto bene tranne che per la virgola che mi da
> errori....sono fermo da 4 giorni su questo problema e non trovo soluzione!!!
> 
> 
> Private Sub Text100_KeyPress(KeyAscii As Integer)
>         Dim TASTO As String
>         TASTO = Chr$(KeyAscii)
>     If (TASTO < "0" Or TASTO > "9") And (KeyAscii <> vbKeyTab) And _
>         (KeyAscii <> vbKeyBack) And (KeyAscii <> vbKeyReturn) And _
>         (KeyAscii <> vbKey,) Then
> 
>         Dim MESSAGGIO
>         MESSAGGIO = MsgBox("Inserire solo numeri !", vbOKOnly + _
>         vbInformation, "ATTENZIONE")
>         KeyAscii = 0
>     End If
> End Sub
> 
> 
> Potete aiutarmi????
> 
> Grazie
> Un programmatore con poca esperienza, ma che vuole migliorare.
> 
> 
> 
Technical Details
Message-ID: <DeuKd.4048$lB4.102843@twister1.libero.it>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!nntp.eutelia.it!nntp.infostrada.it!twister1.libero.it.POSTED!not-for-mail
References: <ofY8d.27855$N45.721491@twister2.libero.it>

Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,3b7c37bd00b752b
X-Google-Attributes: gidf94ee,public
X-Google-Language: ITALIAN,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!nntp.eutelia.it!nntp.infostrada.it!twister1.libero.it.POSTED!not-for-mail
From: Ciccio <ciccio.unicoTOGLIMI@libero.it>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: it, it-it, en-us, en
MIME-Version: 1.0
Newsgroups: free.it.visual-basic
Subject: Re: Aiuto su limitazione scrittura in VB
References: <ofY8d.27855$N45.721491@twister2.libero.it>
In-Reply-To: <ofY8d.27855$N45.721491@twister2.libero.it>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 36
Message-ID: <DeuKd.4048$lB4.102843@twister1.libero.it>
Date: Fri, 28 Jan 2005 17:02:27 GMT
NNTP-Posting-Host: 151.38.10.100
X-Complaints-To: abuse@net24.it
X-Trace: twister1.libero.it 1106931747 151.38.10.100 (Fri, 28 Jan 2005 18:02:27 MET)
NNTP-Posting-Date: Fri, 28 Jan 2005 18:02:27 MET
Organization: [Infostrada]