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

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -