That replaces the current selection with the contents of the clipboard.
If you need to do it manually then it's a bit more work. Remember if you're "pasting" then you are "replacing" the current selection if there is one. So you need to handle that first. You'll need to save SelectionStart if you had a selection as removing the text will screw it up.
The simple way would be
That replaces the current selection with the contents of the clipboard.
If you need to do it manually then it's a bit more work. Remember if you're "pasting" then you are "replacing" the current selection if there is one. So you need to handle that first. You'll need to save SelectionStart if you had a selection as removing the text will screw it up.
After you're done you'll want to invalidate the control to force it to redraw.
I know this is late but the most efficient way appears to be:
This ensures that the cursor is at some position within the textbox, then inserts the text wherever the cursor is located.