Posted By: evildictaitor | Aug 24th, 2007 @ 2:16 AM
page 1 of 1
Comments: 3 | Views: 3106
evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
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.
TommyCarlier
TommyCarlier
I want my scalps!
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.

page 1 of 1
Comments: 3 | Views: 3106
Microsoft Communities