Copy text from a textbox

Asked

Viewed 2,679 times

1

inserir a descrição da imagem aqui

How can I make the "Copy" button copy all text from the textbox?

  • Visual Basic 6 and Visual Basic . NET are distinct languages, in which they wanted their answer?

  • Visual Basic . NET, I didn’t know they were distinct.

2 answers

3


From what I understand is to copy to clipboard, so that’s how in VB:

Clipboard.SetText(Text1.Text)

where Text1.text is your text

  • Exactly! Thank you. ^^

-2

Private Sub Command1_click()
txt.Selstart = 0
txt.Sellength = Len(txt. Text)
txt.Setfocus
Clipboard.Clear
Clipboard.Settext Screen.ActiveControl.Seltext
End Sub

Browser other questions tagged

You are not signed in. Login or sign up in order to post.