🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.vbasic
Article #92472

Re: Pole tekstowe

#92472
From: skyblast
Date: Mon, 31 Oct 2005 14:44
24 lines
1660 bytes
stayheavy napisał(a):
> Witam,
> 
> Mam taki problem: mam pole tekstowe ktore przyjmuje wartosci liczbowe z 
> przedzial 0-255 i przerzuca ta wartosc do pictureboxa ktory w tym momencie 
> zmienia kolor na odpowiedni. W momenie kiedy wpisuje sie liczby, wszystko 
> gra i buczy, ale przy probie wpisania jakiegokolwiek innego znaku program 
> sie wywala. Jak to obejsc?
> 
> Pozdrawiam,
> 
> stayheavy 
> 
> 

Do blokowania wprowadzania liter w texbox-y używam czegoś takiego:

Private Sub TextBox_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    If Not (IsNumeric(Chr(KeyAscii))) Then KeyAscii = 0
    If IsNull(TextBox.Text) = True Then KeyAscii = 48
End Sub

Spróbuj, może to właśnie to czego szukasz.
Pozdrawiam.
Technical Details
Message-ID: <dk5al1$2kr$1@nemesis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <dk58kf$8lp$1@atlantis.news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: skyblast <skyblast@linuxmail.org>
Newsgroups: pl.comp.lang.vbasic
Subject: Re: Pole tekstowe
Date: Mon, 31 Oct 2005 15:44:12 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 24
Message-ID: <dk5al1$2kr$1@nemesis.news.tpi.pl>
References: <dk58kf$8lp$1@atlantis.news.tpi.pl>
NNTP-Posting-Host: host-ip116-239.crowley.pl
Mime-Version: 1.0
X-Trace: nemesis.news.tpi.pl 1130769889 2715 62.111.239.116 (31 Oct 2005 14:44:49 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Mon, 31 Oct 2005 14:44:49 +0000 (UTC)
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: pl, en-us, en
In-Reply-To: <dk58kf$8lp$1@atlantis.news.tpi.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit