I have a next problem. I need to represent a pressed keys combination in a text form. I got pressed keys from KeyEventArgs e…
And when I try to use following code
e.KeyData.ToString(); I got something like this: N, Control …. But I want to get Ctrl+N string.
I think that must be present specific format for String.Format because when i bind property with type Keys to the DataGridView I saw in the table cell string Ctrl+N. It’s mean that DataGridView can do this, and i think this is not done manually…
Thanks a lot!!
The Keys values are probably displayed using the TypeConverter belonging it.
If you want to emulate the behavior of the DataGridView, you should use
The Keys type is tagged with
[TypeConverter(typeof(KeysConverter))], which is whatGetConvertershould return.