c# - When using read-only textbox, some keyboard combinations get handled differently -
it seems though ctrl + e , ctrl + r (at least) don't handled in same way other keyboard combinations. e , r respectively aren't recognized.
the way i've been testing create form textbox , button, add following:
private void button1_click(object sender, eventargs e) { textbox1.readonly = !textbox1.readonly; } private void textbox1_keydown(object sender, keyeventargs e) { bool ctrl = modifierkeys == keys.control; system.diagnostics.debug.writeline("control pressed: " + e.control + " key pressed: " + e.keydata + " modifier control pressed: " + ctrl); } when textbox readonly, key combinations don't work. added context menu strip item handling desired keyboard combinations, interferes textbox's context menu (actually devex spellchecker context menu have associated textbox)--it doesn't display.
does know why or best way around this? can give.
as legendary hans passant points out on this thread, best handle ctrl+x keystrokes intended provide command-like function using processcmdkey() method.
glad worked out you.
Comments
Post a Comment