|
-
Jul 2nd, 2007, 03:42 AM
#1
Thread Starter
Fanatic Member
{RESOLVED} Uppercase at KeyPress Event
Hello,
I'd like to ask something about changing what we type into uppercase char. At the old VB version, I used to use below code :
[vbcode]
'I write below code at keypress event handler
Char = Chr(Keyascii)
Keyascii = Asc(Ucase(Char))
[/vbcode]
The code above will change every keypress of Char to Uppercase without having to press SHIFT and/or CAPSLOCK button.
And now, I'm using C#, and I want to make a similar code to my text object. How should I do that ?
Regards,
~WJ~
Last edited by Wen Lie; Jul 2nd, 2007 at 06:01 AM.
Reason: resolved...
-
Jul 2nd, 2007, 04:53 AM
#2
Re: Uppercase at KeyPress Event
In .NET the textbox control has character casing property you could set it to normal, lower and upper.
this.textBox1.CharacterCasing = CharacterCasing.Upper;
-
Jul 2nd, 2007, 05:59 AM
#3
Thread Starter
Fanatic Member
Re: Uppercase at KeyPress Event
Thanks Marzim,
It's work, and simpler than the old one in VB.
^_^
I guess it right, that .NET really make it simple in coding.
Regards,
~WJ~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|