How to do copy and paste in a textbox

  • Thread starter Thread starter Kwok-ho
  • Start date Start date
K

Kwok-ho

Hi,

I want to do copy and paste data in some textboxs when user tabs and holds
on one of them. I use a ContextMenu to do it, however, I don't know which
textbox has focus when it is being tab and held, so I can't determine which
textbox's content I should copy or paste. Can you give me some suggestions?

Thanks
Kwokho.
 
If the textbox receives focus you could iterate through all controls on the
form until you find the one with focus, which then should be your textbox.
Unless you have control of what controls are focused on your form I think
this is the only way of finding the currently selected control.

hope this helps,

Peter
 
Thanks for you reply, btw, i found that Clipboard class not work in .NET
compact framework, is there any alternative way to
get/set data from/to clipboard?
 
Back
Top