key (CTRL+C)

  • Thread starter Thread starter brenny
  • Start date Start date
B

brenny

I want to realize that pressing CTRL+C keys without keyboard by using code
in the button event.

How can I do?

Thanks
 
I don't exactly understand what you want to do, but if you use shortcuts
you can call the EventHandler directly
I suppose that in your code you have something like :
this.menuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
this.menuItem.Click += new EventHandler(shortcut_Click) ;
then you can call the event handler like this: shortcut_Click(null,null)
 
Hi,

If you want to simple copy text of TextBoxBase'd (e.g. TextBox)
control then there is a ".Copy()" method that copy selected text.

If i missunderstand you, then don't be affraid to feedback.

Cheers!
Marcin
 
Hi,

maybe you could override ProcessDialogKey and use there SendKeys.Send("^C")

Look in help for SendKeys class for more info.

Vlado
 
Back
Top