The question says it all really. The important thing here is localisation.
If I press Shift + 2, I get a double quote " character, whereas on a US keyboard I'd end up with an at @ character.
So is there any mechanism that would convert Keys.Shift | Keys.Num2 correctly to " on my computer and @ on a US one?
Note: This isn't limited to the example given, ideally this solution would work for all sets of printable characters and combinations.
-
-
I assume this is in a KeyDown or KeyUp event? If you want the correct character, you should use the KeyPress event which has a KeyPressEventArgs that has a KeyChar property.
-
TommyCarlier wrote:I assume this is in a KeyDown or KeyUp event? If you want the correct character, you should use the KeyPress event which has a KeyPressEventArgs that has a KeyChar property.
No, it's the ProcessDialogKey() overload.
-
TommyCarlier said:I assume this is in a KeyDown or KeyUp event? If you want the correct character, you should use the KeyPress event which has a KeyPressEventArgs that has a KeyChar property.
Hi,
In my case is DataGridViewCell.KeyEntersEditMode(KeysEventArgs e). The idea is to hadle chars like '*', '\' and '+' for which I want a custom behavior.
Since DataGridViewCell.KeyEntersEditMode(KeysEventArgs e) is called from DataGridView.ProcessKeyEventArgs(ref Message m), perhaps an extended KeyEventArgs could provide the charcode for printable characters.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.