Talk2Tom11 Posted January 29, 2006 Posted January 29, 2006 (edited) 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. Edited January 29, 2006 by Talk2Tom11 Quote
JumpyNET Posted January 29, 2006 Posted January 29, 2006 If you are using VS 2005 ... It's quite simple in Visual Studio 2005: My.Computer.Clipboard.SetText(TextBox1.Text) But if you're using an older version this won't work. Quote
Nate Bross Posted January 29, 2006 Posted January 29, 2006 Here's a link to a C# example http://www.codeproject.com/csharp/dotnet_clipboard.asp HTH Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Leaders snarfblam Posted January 29, 2006 Leaders Posted January 29, 2006 It's quite simple in Visual Studio 2005: 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 Quote [sIGPIC]e[/sIGPIC]
Talk2Tom11 Posted January 29, 2006 Author Posted January 29, 2006 When i use my code... Clipboard.SetDataObject(textBox1.text) it deletes it from the clipboard once the form closes... i want it to stay until i copy something else. Quote
Administrators PlausiblyDamp Posted January 29, 2006 Administrators Posted January 29, 2006 Clipboard.SetDataObject(textBox1.text, True) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.