473,320 Members | 2,080 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,320 software developers and data experts.

Char value from Keys class

I have the e.KeyCode value from KeyEventArgs in KeyDown event handler and I
want to convert this in char value. It is posible? How?

The other case: If I have the Message class, I can convert the character
value to char?

Thank you for help!

Jun 2 '06 #1
3 21295

mychar = (char)e.KeyCode;

Paul
Mihaly wrote:
I have the e.KeyCode value from KeyEventArgs in KeyDown event handler and I
want to convert this in char value. It is posible? How?

The other case: If I have the Message class, I can convert the character
value to char?

Thank you for help!

Jun 2 '06 #2
Thank you for your answer.
This is workimg, but not in any situation. If I press numbers from the
numeric keyboard, the (char) e.KeyCode returns a, b, c, ...

Exist an other solution?

Thank you!

Mihaly

"Paul Cheetham" wrote:

mychar = (char)e.KeyCode;

Paul
Mihaly wrote:
I have the e.KeyCode value from KeyEventArgs in KeyDown event handler and I
want to convert this in char value. It is posible? How?

The other case: If I have the Message class, I can convert the character
value to char?

Thank you for help!

Jun 2 '06 #3
e.KeyCode returns the KeyCode which might be useful for keys like
Ctrl+C, Alt+F, etc
Try using
myChar = (char)e.KeyValue;
Hope that helps
Mihaly wrote:
Thank you for your answer.
This is workimg, but not in any situation. If I press numbers from the
numeric keyboard, the (char) e.KeyCode returns a, b, c, ...

Exist an other solution?

Thank you!

Mihaly

"Paul Cheetham" wrote:

mychar = (char)e.KeyCode;

Paul
Mihaly wrote:
I have the e.KeyCode value from KeyEventArgs in KeyDown event handler and I
want to convert this in char value. It is posible? How?

The other case: If I have the Message class, I can convert the character
value to char?

Thank you for help!


Jun 2 '06 #4

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

Similar topics

3
by: Bart Kevelham | last post by:
Hi there, due to some compatibility issues I use char* for strings. I want to use an STL map where I use these char* as key. But somehow this doesn't seem to work. The first time I add something...
9
by: Christopher Benson-Manica | last post by:
I need a smart char * class, that acts like a char * in all cases, but lets you do some std::string-type stuff with it. (Please don't say to use std::string - it's not an option...). This is my...
1
by: gerrod | last post by:
Hi - Does anyone know a way to created a SortedList (in the System.Collections namespace) that will sort on VALUES instead of KEYS... ? The scenario is this - I have a SortedList containing...
5
by: Flip | last post by:
I'm trying to create a form which a user can type out a key, and the CTRL-ALT-SHIFT keys are recognized (via ModifiedKeys object) and then pass the letter the user pressed to the windows API method...
0
by: Matt | last post by:
I derived my own custom class from the datagrid class. I overrode the ProcessCmdKey Function, like this, to catch the up and down arrow keys: ====== Protected Overrides Function...
26
by: the.tarquin | last post by:
Okay, this one has me totally baffled. I have a function, getParsedKey(char* key, char* returnString). I pass in the key I want, it retrieves it from a data structure and puts the value in...
0
by: =?Utf-8?B?cGI2NDgxNzQ=?= | last post by:
We have been having this problem for months and always assumed it was because of our somewhat complicated setup. I have just spent almost all of today making this into a simple example that can be...
9
by: Johnny Jörgensen | last post by:
Hi y'all I've got a custom control that is inherited from a normal TextBox. To that, I've added a new property that I call "Units", Which is a collection class containing members of a "Unit"...
9
by: Nathan Sokalski | last post by:
I am looking for a collection where I can find the key based on the value or the value based on the key. All the classes I have found in the System.Collections namespace only allow you to get the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.