Results 1 to 10 of 10

Thread: rich textbox flickers

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    rich textbox flickers

    I'm trying to highlight certain keywords AS THE USER TYPES text in a rich textbox. The only way I could think of was to search through the whole textbox everytime the CHANGED event is fired, and then colorize the keywords (which turns out to be really slow).

    The problem is that it flickers alot, because I'm selecting and unselecting certain keywords in order to colorize them. I tried the suspendlayout method, but sounds like it doesnt do anything whatsoever
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aah I used the LockWindow API, and it doesnt flicker anymore. But it's extreemly slow. If you start typing a little fast, it wont update the textbox as you type what should I do
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Maybe you could thread the highlight code so it doesn't hang the rest of the app.

  4. #4
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Another way is to only colorize on enters and spaces because thats really when you want to check words to be colored. Add that to the threading method and you should be ok.

  5. #5

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aah didnt work
    it makes a big mess. The function that I have is supposed to SELECT a part of the text and then highlight it. If I call it by a thread, then the selected part can be deleted as I'm typing.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Negative0
    Another way is to only colorize on enters and spaces because thats really when you want to check words to be colored. Add that to the threading method and you should be ok.
    aah works mucho better thanks

    one problem though: how can I find out if the use if pasting something?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    umm so is there a way to find out if the user is pasting something ?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Maybe in the TextChanged event you could keep a static variable of the last Text.Length then if it increases by more than 1 they probably pasted something in instead of typed it in.

  9. #9
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    well i didnt read the entire post but sometime ago i saw in assembly page something about this..the guy said that his first attemp was just like u to use the richtextbox and some api's but it got really really slow...so the thing he done was with a regular textbox and some api's..
    \m/\m/

  10. #10

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    I guess I should forget it
    thanks for helping though
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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