How to do copy and paste in a textbox

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.
 
P

Peter B

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
 
K

Kwok-ho

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top