Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21256

Copy Text From A Text Box

$
0
0
Hi,
I want to be able to copy text from a textbox to my windows clipboard.

I have the code for that already
"Clipboard.SetText(txtAccountNumber.Text & vbCrLf & lblCustomerName.Text & txtCustomerName.Text)"

but I want it only to copy if the text box has writing in it, otherwise when you paste it there's lots of empty gaps because the text box hasn't had text hadn't anything written inside of it.

I was thinking of an If statement like this, but this doesn't work:

If txtAccountNumber.Text = True Then
Clipboard.SetText(txtAccountNumber.Text)
Else
txtAccountNumber.Text = False
End If

Any ideas?

Viewing all articles
Browse latest Browse all 21256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>