Valhalla Legends Forums Archive | Visual Basic Programming | How to copy text?

AuthorMessageTime
Forged
How would I make a button copy text in a text box? I tryed text1.seltext, but that didn't work.
June 13, 2004, 7:02 AM
UserLoser.
Copy text to clipboard? Store the text in a variable?

Since you didn't be specific, I'll answer both...:

[code]
Private Sub SomeButton_Click()
Dim TheMessage as String
TheMessage = MyTextBox.Text
MsgBox "The text in the text box is " & TheMessage & "!"
End Sub
[/code]

Or to put it to the clipboard

[code]
Private Sub SomeButton_Click()
Dim TheMessage as String
TheMessage = MyTextBox.Text
Clipboard.SetText TheMessage
End Sub
[/code]
June 13, 2004, 7:48 AM
Forged
[code]Private Sub SomeButton_Click()
Dim TheMessage as String
TheMessage = MyTextBox.Text
Clipboard.SetText TheMessage
End Sub[/code]
Is what I was looking for. Thanks alot.
June 13, 2004, 7:35 PM

Search