🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.winforms.controls.using
Article #20

Re: Changing text to Uppercase - not quite there yet....

#20
From: John F
Date: Wed, 25 May 2005 07:33
41 lines
2143 bytes
Thanks, Marc.

I know I'm missing something incredibly obvious but I've tried a few variations without success:

private void cboxDiag1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
     Char.ToUpper(e.KeyChar);
}
 and

private void cboxDiag1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
   char myChar = e.KeyChar;
   Char.ToUpper( myChar );
   e.KeyChar = myChar;
}

But no success...

Could you please steer me in the right directior?

Thanks!

John F.


"Marc Rohloff [TeamB]" <"on request"> wrote:
>On 18 May 2005 00:12:31 -0700, John F. wrote:
>
>> I'm trying to display all text in a control in uppercase as I enter it. I've tried using the 'text_changed" method of, say, a combobox, as follows:
>> this.myComboBox.Text.ToUpper()
>> but this doesn't cause the text to appear in uppercase.
>
>> How can i do this?
>
>Handle the KeyPress event and convert the Key to uppercase.
>
>-- 
>Marc Rohloff [TeamB]
>marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID: <42942a5b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!atl-c03.usenetserver.com!wn12feed!worldnet.att.net!24.30.200.11!news-east.rr.com!news.rr.com!newscon06.news.prodigy.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <428aeadf$1@newsgroups.borland.com> <zkiev5tdugc2.dlg@marcrohloff.40tude.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff3c,e8f286f0f787b5f2
X-Google-Attributes: gid1eff3c,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "John F" <jfowler@pol.net>
Sender: "John F" <jfowler@pol.net>
Reply-To: "John F" <jfowler@pol.net>
Subject: Re: Changing text to Uppercase - not quite there yet....
Newsgroups: borland.public.csharpbuilder.winforms.controls.using
X-User-Info: 24.20.189.226     
References: <428aeadf$1@newsgroups.borland.com> <zkiev5tdugc2.dlg@marcrohloff.40tude.net>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42942a5b$1@newsgroups.borland.com>
Date: 25 May 2005 00:33:47 -0700
X-Trace: newsgroups.borland.com 1117006427 207.105.83.66 (25 May 2005 00:33:47 -0700)
Lines: 42
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!atl-c03.usenetserver.com!wn12feed!worldnet.att.net!24.30.200.11!news-east.rr.com!news.rr.com!newscon06.news.prodigy.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!feed5.newsreader.com!newsreader.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail