Select all text in a multiline textbox

I have a text box with multiple lines of characters
i have a command button

i need the command button
to select all the text in the textbox
and copy it to memory /  (clipboard) /(ctrl + c)

so that i can just paste it into another program
can i do this if a the textbox is replaced with a label?




jxhardingAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
deathman5Connect With a Mentor Commented:
To Select All Test1:

Text1.SelStart = 0         'start position is at the beginning
Text1.SelLength = Len(Text1.Text)  'length is all available text

To Copy All Text1 To Clipboard:

Clipboard.Clear
Clipboard.SetText Text1.Text

hope it help :)
0
 
twiliConnect With a Mentor Commented:
Put these lines under your cmd-button:

ClipBoard.Clear      ' Clear Clipboard.
Clipboard.SetText Textbox.Text, vbCFText      ' Put text on Clipboard (txt-format).

/O.
0
 
ennixoConnect With a Mentor Commented:
and to copy a label's text (caption) to the clipboard :

Clipboard.Clear
Clipboard.SetText LabelName.Caption
0
 
jxhardingAuthor Commented:
all answers working , thank you, before i split the points,
if i have the following in the textbox


line1
line2
line3
line4

and i only select line2 and line3 via dragging  & holding the mouse over it, is the only way
i can copy this selected text by sending sendkeys ctrl & C?
0
All Courses

From novice to tech pro — start learning today.