rnm89 Posted April 8, 2003 Posted April 8, 2003 I was wondering, is it possible to highlight & copy text to the clipboard from within textbox1.text using my button2 all in one step. I am using the " Clipboard.SetDataObject(TextBox1.SelectedText)" command within my button2 properties, but I still have to highlight the text. Quote
Leaders Squirm Posted April 8, 2003 Leaders Posted April 8, 2003 'To highlight text: TextBox1.SelectionStart = 0 TextBox1.SelectionLength = Len(TextBox1.Text) 'To just copy the whole text: Clipboard.SetDataObject(TextBox1.Text) Quote Search the forums | Still IRCing | Be nice
rnm89 Posted April 8, 2003 Author Posted April 8, 2003 Worked Great!! Thanks for the code. It worked great!! Quote
*Gurus* divil Posted April 9, 2003 *Gurus* Posted April 9, 2003 Or alternatively: TextBox1.SelectAll() TextBox1.Copy() Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
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.