Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Forged on June 13, 2004, 02:02 AM

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

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


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


Or to put it to the clipboard


Private Sub SomeButton_Click()
   Dim TheMessage as String
   TheMessage = MyTextBox.Text
   Clipboard.SetText TheMessage
End Sub
Title: Re:How to copy text?
Post by: Forged on June 13, 2004, 02:35 PM
Private Sub SomeButton_Click()
   Dim TheMessage as String
   TheMessage = MyTextBox.Text
   Clipboard.SetText TheMessage
End Sub

Is what I was looking for.  Thanks alot.