When I paste into a RTBox how can I make it paste starting at the point where I place the cursor?
JO
VB Code:
'I'm currently using this to paste RTB1.Text = Clipboard.GetText 'but this will overwrite anything already in the RTB1
Printable View
When I paste into a RTBox how can I make it paste starting at the point where I place the cursor?
JO
VB Code:
'I'm currently using this to paste RTB1.Text = Clipboard.GetText 'but this will overwrite anything already in the RTB1
RTB1.Text = Left(RTB1.Text, CursPos) & ClipBoard.GetText & Mid(RTB1.Text, CursPos + 1)
That places it at the beggining of the file but not where the cursor is.:confused:
That's becuase you are not using option explicit and did not declare curspos.
CursPos should be however you are determining the cursor location, like SelLength.
Oh! Thanks.
ignorance is bliss :D
It's easier just to use the "SelText" property.
Code:RTB1.SetFocus
RTB1.SelText = Clipboard.GetText
Well, chalk another one up to MegaTron :).
I feel like I am pretty proficient when it comes to VB, but MegaTron, your skills seems to dwarf mine own. (As in make my skills look miniscule compared to yours.)
Well, at least I'm learnin somethin.