c# - execute action on hotkey without capture it -
i want execute action in c# application when user clicks e.g. ctrl+c combination. i've found spcific code, want - when user hits ctrl+c - selected text copied & executed action in app instead execute action.
use keydown event:
private void m_keydown(object sender, system.windows.forms.keyeventargs e) { if (e.control && e.keycode == keys.c) { //grab selected text clipboard.settext(richtextbox1.selectedtext); string s = clipboard.gettext(); //execute action string } } you need register key event handler designer.cs whetever use it. example:
this.richtextbox1.keydown += new system.windows.forms.keyeventhandler(this.m_keydown);
Comments
Post a Comment