Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

What would this code be?

I'm making a bio creating application, and I need some help.
Could you please tell me the code I need for this situation.

I have Textbox1.
I also have Button1.

I want to make it so that by clicking Button1, I copy (to my clipboard) the text in Textbox1.

Help would be appreciated.
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    TextBox1.SelectAll()
    TextBox1.Copy()
End Sub

This should work, I tested it.
Code
My.Computer.Clipboard.SetText(Textbox1.Text)
(Jun 18, 2010 04:06 AM)SIM-263922 Wrote:  
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    TextBox1.SelectAll()
    TextBox1.Copy()
End Sub

This should work, I tested it.

Thank you very much. +rep.
(Jun 18, 2010 04:14 AM)Xawn Wrote:  Thank you very much. +rep.

LMAO.. saying +rep does NOT add rep .. 🤣🤣🤣

u need to be L33T/UB3R for sharing rep 😉
(Jun 18, 2010 04:15 AM)๖ۣۜBlueAce™ Wrote:  LMAO.. saying +rep does NOT add rep .. 🤣🤣🤣

u need to be L33T/UB3R for sharing rep 😉

lmao well we all started some where didnt we :)
(Jun 18, 2010 04:15 AM)๖ۣۜBlueAce™ Wrote:  LMAO.. saying +rep does NOT add rep .. 🤣🤣🤣

u need to be L33T/UB3R for sharing rep 😉
I'm not stupid bro.

I am used to Se7en Sins, so I said that, to find there's a Thanks button instead.

ON TOPIC:

Alright.
If this copies one single text box:
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  TextBox1.SelectAll()
  TextBox1.Copy()

How could I make it copy two Textboxes, by clicking one button?
(Jun 18, 2010 04:23 AM)Xawn Wrote:  I'm not stupid bro.

I am used to Se7en Sins, so I said that, to find there's a Thanks button instead.

ON TOPIC:

Alright.
If this copies one single text box:
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  TextBox1.SelectAll()
  TextBox1.Copy()

How could I make it copy two Textboxes, by clicking one button?

Code
My.Computer.Clipboard.SetText(Textbox1.Text & Textbox2.Text)

Or

Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  TextBox1.SelectAll()
  TextBox1.Copy()
  TextBox2.SelectAll()
  TextBox2.Copy()

Don't know if this works tho
Cheers bro, first one works fine, second one overwrites the previous text.