cut, copy, paste

C

Collin Jamieson

how can I write functions to cut, copy & paste the
currently selected text. this is new to me any code
examples would be great.


thanks CJ
 
J

January Smith

This sample can be found in the TextBoxBase.SelectedText Property of the
documentation.

' Ensure that text is selected in the text box.
If textBox1.SelectionLength > 0 Then
' Copy the selected text to the Clipboard.
textBox1.Copy()
End If

Later,
January
 
C

Collin Jamieson

yes but how can this be applied from the parents main
menu to any textbox on the active child
 
J

January Smith

frmMain.ActiveForm.ActiveControl

This will return the currently active control on the currently active form.

Later,

January
 
O

One Handed Man

Normally, you would use the selected control. It may not have focus but that
is the one you would need. I think there may be some abmiguity in your
question here.

Give us an accurate description ( example ) 'Exactly' what you might want to
do.

OHM
 
O

One Handed Man

I pasted to the wrong level. Sorry Armin, did'nt mean to try and steal your
thunder.

Regards - OHM
 

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