Results 1 to 4 of 4

Thread: forcing paste to paste txt in an rtb

  1. #1

    Thread Starter
    Fanatic Member mikeycorn's Avatar
    Join Date
    Jun 2000
    Location
    Aliso Viejo, CA, USA
    Posts
    526

    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
    ~ mikeycorn

    With over 45,000 Questions in the User Submitted Database, it's the Most Popular Quiz Creation Software on the Net:

    PEST - The Personal Exam Self-Tester

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    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

  3. #3

    Thread Starter
    Fanatic Member mikeycorn's Avatar
    Join Date
    Jun 2000
    Location
    Aliso Viejo, CA, USA
    Posts
    526
    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?
    ~ mikeycorn

    With over 45,000 Questions in the User Submitted Database, it's the Most Popular Quiz Creation Software on the Net:

    PEST - The Personal Exam Self-Tester

  4. #4

    Thread Starter
    Fanatic Member mikeycorn's Avatar
    Join Date
    Jun 2000
    Location
    Aliso Viejo, CA, USA
    Posts
    526
    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.)
    ~ mikeycorn

    With over 45,000 Questions in the User Submitted Database, it's the Most Popular Quiz Creation Software on the Net:

    PEST - The Personal Exam Self-Tester

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width