Convert keypress to upper case 
Author Message
 Convert keypress to upper case

In VB 6 we could just set the KeyCode = the asc(ucase$(chr$(keycode))) and
be done with it.

How would I go about taking a keypress on say a text control and overriding
it and having it actually enter a capitalized value?

Thanks!
James Hancock



Wed, 04 May 2005 12:51:36 GMT  
 Convert keypress to upper case
Hi James,

try:

int UpperKeyCode = (int)(Char.ToUpper((char)keycode));

Quote:
> In VB 6 we could just set the KeyCode = the asc(ucase$(chr$(keycode))) and
> be done with it.

Best wishes,
Detlef


Wed, 04 May 2005 19:22:50 GMT  
 Convert keypress to upper case
ok, but how do I then get it to override the key that was pressed with the
upper case one?  The part you're showing me is the easy part. I just can't
figure out how to override the key press and get it to fill in the text
control with the uppercase character instead of the lower case one.


Quote:
> Hi James,

> try:

> int UpperKeyCode = (int)(Char.ToUpper((char)keycode));

> > In VB 6 we could just set the KeyCode = the asc(ucase$(chr$(keycode)))
and
> > be done with it.

> Best wishes,
> Detlef



Fri, 06 May 2005 00:04:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Fastest way to convert lower to upper case?

2. convert string to Upper case

3. Converting Strings to Upper Case

4. moving upper case names to lower case

5. Upper case / lower case problem in IDL file

6. Upper and lower case words

7. Upper Case

8. Select returning UPPER & LOWER CASE

9. testing 'string' for upper-case letters

10. Change a foreign language string to upper case

11. Upper case

12. change char in edit box to upper case as it is typed

 

 
Powered by phpBB® Forum Software