Article View: free.it.visual-basic
Article #348Re: mi manca poco...
From: Ciuchino
Date: Thu, 07 Sep 2006 21:20
Date: Thu, 07 Sep 2006 21:20
70 lines
2908 bytes
2908 bytes
Un altro passetto � andato ma... ( come faccio ad aggiungere all "IF NOT"
il tasto cancella a sx ??? )
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
If Not KeyAscii = Asc(",") Then
KeyAscii = 0
Beep
End If
End If
End Sub
"Ciuchino" <vane1111111111111@tiscali.it> ha scritto nel messaggio
news:4500686a$0$998$5fc30a8@news.tiscali.it...
> Ciao salvezza,
> con la tua sintassi mi da un errore: 424 "necessario oggetto"
>
> Se invece provo con :
> If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
> KeyAscii = 0
> Beep
> End If
>
> Cos� funziona ma... essendo un text di inserimento prezzo dovrei oltre ai
> numeri inserire anche la , per i decimali.
>
> Ho provao a inserire
> If KeyAscii < Asc("0") Or KeyAscii > Asc("9") KeyAscii <> Asc(",")Then
> KeyAscii = 0
> Beep
> End If
>
> Ma cos� non mi prende nulla, AIUTAMI ti prego :-)
>
> Grazie 1000 x la tua disponibilit� !!!
>
>
>
> "Morrie" <morrie@katamail.com> ha scritto nel messaggio
> news:44ff3d20$0$15878$4fafbaef@reader2.news.tin.it...
>> Ciuchino ha scritto:
>>> Ragazzi AIUTONE x una gran cazzata che non trovo !!!
>>>
>>> Ho fatto un breve programma che prevede l'inserimento di un prezzo.
>>> Come cavolo si fa a far inserire nel TEXT solo numeri e non lettere ?!!?
>>>
>>> Mi vergogno a chiedervelo ma non trovo nulla che mi aiuti...
>>>
>>> Ps. dimenticavo ma... vi sarete accorti ugualemnte, sono ai primi passi
>>> :-P
>>>
>>>
>>>
>>
>> Ciao,
>> nell'evento keypress della text box metti il seguente codice:
>>
>> If (Not IsNumeric(e.KeyChar)) Then
>> e.Handled = True
>> End If
>>
>> Cos� qualsiasi tasto diverso da un numero verr� rifiutato e come se non
>> fosse mai stato premuto.
>>
>> Ciao!!!
>
>
Technical Details
Message-ID:
<45008d1e$0$13731$5fc30a8@news.tiscali.it>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!atl-c05.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!news.mailgate.org!draco.tiscalinet.it!news-f2.tiscali.it!not-for-mailReferences:
<44ff3b8b$0$995$5fc30a8@news.tiscali.it> <44ff3d20$0$15878$4fafbaef@reader2.news.tin.it> <4500686a$0$998$5fc30a8@news.tiscali.it>Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,571c1c69b11bcfa0 X-Google-Attributes: gidf94ee,public X-Google-Language: ITALIAN,ASCII Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!atl-c05.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!news.mailgate.org!draco.tiscalinet.it!news-f2.tiscali.it!not-for-mail From: "Ciuchino" <vane1111111111111@tiscali.it> Newsgroups: free.it.visual-basic References: <44ff3b8b$0$995$5fc30a8@news.tiscali.it> <44ff3d20$0$15878$4fafbaef@reader2.news.tin.it> <4500686a$0$998$5fc30a8@news.tiscali.it> Subject: Re: mi manca poco... Date: Thu, 7 Sep 2006 23:20:29 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Lines: 72 Message-ID: <45008d1e$0$13731$5fc30a8@news.tiscali.it> Organization: Tiscali SpA NNTP-Posting-Host: 84.221.96.173 X-Trace: 1157664030 news.tiscali.it 13731 84.221.96.173:1166 X-Complaints-To: abuse@tiscali.it