473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Converting to Upper Case

How do I convert a field that is filled in to uppercase within the C3 code?
I see the ToUpper in there, but how do I get the text box to convert this to
upper when you change focus or move to another text box?

Nov 16 '05 #1
8 65082
Brian,

If you mean a Winforms TextBox, wouldn't it be eaiser to just set the
CharacterCasing property to CharacterCasing.Upper, so that all input
is automatically converted to upper case?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
Yes that is what I am trying to do, but can't figure out where or how to get
that in there to get it to work. this is a Web Form so I am thinking that
this is what the problem is.
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Brian,

If you mean a Winforms TextBox, wouldn't it be eaiser to just set the
CharacterCasing property to CharacterCasing.Upper, so that all input
is automatically converted to upper case?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #3
Okay here is the code that I came up with, but it doesn't change the
existing information in the text box on focus change.

string EventName;

EventName = txtEventName.Text;

EventName.ToUpper();

txtEventName.Text = EventName;

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Brian,

If you mean a Winforms TextBox, wouldn't it be eaiser to just set the
CharacterCasing property to CharacterCasing.Upper, so that all input
is automatically converted to upper case?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #4
Brian

try this:

txtEventName.CharacterCasing=CharacterCasing.Upper ;

Note however, that only typed characters will be converted. If you do
something like txtEventName.Text="lowercase string"; contents of text box
will stay in lower case. I think it is small bug in TextBox control, anyway
that's how it is.
HTH
Alex

"Brian Conway" <Br**********@qwest.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Okay here is the code that I came up with, but it doesn't change the
existing information in the text box on focus change.

string EventName;

EventName = txtEventName.Text;

EventName.ToUpper();

txtEventName.Text = EventName;

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Brian,

If you mean a Winforms TextBox, wouldn't it be eaiser to just set the
CharacterCasing property to CharacterCasing.Upper, so that all input
is automatically converted to upper case?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Nov 16 '05 #5
I tried that one before but was getting an error of

System.Web.UI.WebControls.TextBox does nto contain a definition for
CharacterCasing

"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Brian

try this:

txtEventName.CharacterCasing=CharacterCasing.Upper ;

Note however, that only typed characters will be converted. If you do
something like txtEventName.Text="lowercase string"; contents of text box
will stay in lower case. I think it is small bug in TextBox control, anyway that's how it is.
HTH
Alex

"Brian Conway" <Br**********@qwest.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Okay here is the code that I came up with, but it doesn't change the
existing information in the text box on focus change.

string EventName;

EventName = txtEventName.Text;

EventName.ToUpper();

txtEventName.Text = EventName;

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Brian,

If you mean a Winforms TextBox, wouldn't it be eaiser to just set the
CharacterCasing property to CharacterCasing.Upper, so that all input
is automatically converted to upper case?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.



Nov 16 '05 #6
Assuming you have a textbox named TextBox1 you need to define the
Leave event for this text box, and then write the functionality for
that function:

this.TextBox1.Leave += new System.EventHandler(this.TextBox1_Leave);

private void TextBox1_Leave(object sender, System.EventArgs e)
{
this.TextBox1.Text=this.TextBox1.Text.ToUpper();
}

"Brian Conway" <Br**********@qwest.com> wrote in message news:<ey**************@TK2MSFTNGP10.phx.gbl>...
How do I convert a field that is filled in to uppercase within the C3 code?
I see the ToUpper in there, but how do I get the text box to convert this to
upper when you change focus or move to another text box?

Nov 16 '05 #7
Now it's clear - you did not specify that you use Web.UI control and
everybody assumed it was WinForms one.

Then you have to hook up some available event - like Validate - and use your
code there. Or maybe css style if browser supports it - see
Customizing the Appearance of ASP.NET Server Controls Using Styles on MSDN
or in .Net help file.

HTH
Alex

"Brian Conway" <Br**********@qwest.com> wrote in message
news:OG*************@TK2MSFTNGP11.phx.gbl...
I tried that one before but was getting an error of

System.Web.UI.WebControls.TextBox does nto contain a definition for
CharacterCasing

"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Brian

try this:

txtEventName.CharacterCasing=CharacterCasing.Upper ;

Note however, that only typed characters will be converted. If you do
something like txtEventName.Text="lowercase string"; contents of text box will stay in lower case. I think it is small bug in TextBox control,

anyway
that's how it is.
HTH
Alex

"Brian Conway" <Br**********@qwest.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Okay here is the code that I came up with, but it doesn't change the
existing information in the text box on focus change.

string EventName;

EventName = txtEventName.Text;

EventName.ToUpper();

txtEventName.Text = EventName;

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
> Brian,
>
> If you mean a Winforms TextBox, wouldn't it be eaiser to just set the > CharacterCasing property to CharacterCasing.Upper, so that all input
> is automatically converted to upper case?
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.



Nov 16 '05 #8

"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:uV**************@TK2MSFTNGP10.phx.gbl...
Now it's clear - you did not specify that you use Web.UI control and
everybody assumed it was WinForms one.

Then you have to hook up some available event - like Validate - and use your code there. Or maybe css style if browser supports it - see
Customizing the Appearance of ASP.NET Server Controls Using Styles on MSDN
or in .Net help file.

An even easier solution:
add the style attribute: text-transform: uppercase to the textbox

hth
andrew
Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kevin | last post by:
Hello, we've an Oracle transition in the pipeline and want to convert all our database objects to upper case. Any one got a script or technique (other than manual) to do it? Many thanks, Kevin.
4
by: programmerforhire | last post by:
Hello all, Is there a way to setup an ms-access table so that when I enter text in the 'datasheet' mode, it will automatically be converted tp upper case. Or must I use a Form for this? rex
17
by: Janice | last post by:
char* line = "abcd"; How to convert the line to upper case and print? Any option for printf to do this? Thanx
6
by: Manish | last post by:
In my application there is need for only upper case chars.. Currently I am making entry to upper case when user leaves focus of the text control. I want to do some modification here...When user...
5
by: Nelson | last post by:
In my web form, I am converting all lower case letters to upper case when the user types the characters in the edit boxes. I am achieving that by injecting client side script (onkeyup event) for...
2
by: Richard Keller | last post by:
How can I only allow user to enter upper case letters into a text box, and if he enters a lower case letter, change it to upper case. in vb6 I would use the keypress event and change the key to...
19
by: Eric Lindsay | last post by:
Should HTML 4.01 Strict markup be done in upper case or in lower case? I understand that HTML allows either upper or lower case. I also notice that XHTML apparently requires lower case. However I...
8
by: csanjith | last post by:
Hi, i have a situaion where i need to convert the characters entered in an text field to upper case using C. The configuration id utf8 environment in which user can enter any character (single ,...
5
by: bob | last post by:
Now this ought to be a simple matter. But nothing's simple in the Net world, I'm finding. In vb6 you could use "!" to force text to upper case in the format function. I've searched the vb.net...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.