ADO DOT NET Posted December 7, 2007 Posted December 7, 2007 Hi, When I want to paste a text into a text box I use this code: Clipboard.SetText("My Text") SubjectTextBox.Paste() It has a problem: it removes the previous clipboard contents, is there a way to paste a specific text into text box without working with clipboard? Thanks. Quote
Administrators PlausiblyDamp Posted December 7, 2007 Administrators Posted December 7, 2007 Is there a requirement to use the paste functionality at all? If so copying stuff to the clipboard removes the existing contents - this is how it is designed to work. Could you not just assign the value directly to the text property? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ADO DOT NET Posted December 7, 2007 Author Posted December 7, 2007 You mean something like: Dim SavedText As String = "My Text" SubjectTextBox.Text += SavedText Nope! This won't work because I want to to be exactly pasted at the location of cursor, and if some text is marked be replaced, the same behavior as paste function. I was thinking if it has a paste option that allow user to assign some text to be pasted instead of pasting from clipboard! Quote
Administrators PlausiblyDamp Posted December 7, 2007 Administrators Posted December 7, 2007 TextBox1.SelectedText = "My Text" 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.