|
-
May 8th, 2002, 05:59 PM
#1
Thread Starter
Fanatic Member
Help with pasting
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
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
May 8th, 2002, 06:00 PM
#2
RTB1.Text = Left(RTB1.Text, CursPos) & ClipBoard.GetText & Mid(RTB1.Text, CursPos + 1)
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
May 8th, 2002, 06:09 PM
#3
Thread Starter
Fanatic Member
That places it at the beggining of the file but not where the cursor is.
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
May 8th, 2002, 06:14 PM
#4
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.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
May 8th, 2002, 06:36 PM
#5
Thread Starter
Fanatic Member
Oh! Thanks.
ignorance is bliss
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
May 8th, 2002, 07:17 PM
#6
It's easier just to use the "SelText" property.
Code:
RTB1.SetFocus
RTB1.SelText = Clipboard.GetText
-
May 8th, 2002, 07:22 PM
#7
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.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|