|
-
Oct 10th, 2002, 02:12 PM
#1
Thread Starter
Fanatic Member
forcing paste to paste txt in an rtb
I need the length of an rtb, but I only want to deal with txt.
Right now the way my program's set up, if the user pastes rich text, they can then use a command that makes rtb = rtb.text and that works to remove the formatting, but I just downloaded a program from planet source code called Bobo Pad that has a rtb that works with text only and when you paste rich text into it, all you see is the txt, as if you'd pasted into notepad.
I'd like to save my users that extra step of having to unformat any rich text they may want to paste.
I've tried looking at the code, but can't figure out how it's done. Does anyone know how Bobo did it?
Here's the link to Bobo Pad at psc:
http://www.planet-source-code.com/vb...bo%5F343401485
-
Oct 10th, 2002, 02:16 PM
#2
So Unbanned
Re: forcing paste to paste txt in an rtb
Originally posted by mikeycorn
I need the length of an rtb, but I only want to deal with txt.
Right now the way my program's set up, if the user pastes rich text, they can then use a command that makes rtb = rtb.text and that works to remove the formatting, but I just downloaded a program from planet source code called Bobo Pad that has a rtb that works with text only and when you paste rich text into it, all you see is the txt, as if you'd pasted into notepad.
I'd like to save my users that extra step of having to unformat any rich text they may want to paste.
I've tried looking at the code, but can't figure out how it's done. Does anyone know how Bobo did it?
Here's the link to Bobo Pad at psc:
http://www.planet-source-code.com/vb...bo%5F343401485
On the change event you could put:
st = rtb.selstart
sl = rtb.sellength
rtb.richtext = rtb.text
rtb.selstart = st
stb.sellength = sl
-
Oct 10th, 2002, 02:28 PM
#3
Thread Starter
Fanatic Member
Thanks, De, and it does work that way, but now when you do your normal typing, it's flashing and jittering so much it could give a epileptic a seizure. ;-)
Is there any way to limit your code to only fire when there's a paste event?
-
Oct 10th, 2002, 02:57 PM
#4
Thread Starter
Fanatic Member
Okay, I put a rtb.text = rtb.text into rtb_OLEDragDrop and that took care of the fluttering!
It's weird though, now when I paste, I get about a second of delay as the hard drive works and then it pastes. It's not a real problem from a user standpoint, but it's strange, I'm not pasting very much text and yet there's a good full second of hard drive access (on a very fast system.)
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
|