add to clipboard

Talk2Tom11

Centurion
Joined
Feb 22, 2004
Messages
144
Location
Westchester, NY
I was wondering if anyone know the code for this problem.

I was to click a button and have the text from within txtbox1 'copied' to the clipboard.

I pretty much want the button to act as a ctrl+c.

if anyone can help me that would be great.
 
Last edited:
If you are using VS 2005 ...

It's quite simple in Visual Studio 2005:

Visual Basic:
My.Computer.Clipboard.SetText(TextBox1.Text)

But if you're using an older version this won't work.
 
JumpyNET said:
It's quite simple in Visual Studio 2005:

Visual Basic:
My.Computer.Clipboard.SetText(TextBox1.Text)

But if you're using an older version this won't work.
Keep in mind that the My keyword is exclusive to VB 2005, not VS 2005
 
When i use my code...

Visual Basic:
Clipboard.SetDataObject(textBox1.text)

it deletes it from the clipboard once the form closes... i want it to stay until i copy something else.
 
Back
Top