• 0

[vb .net] Flicker in rich text box?


Question

19 answers to this question

Recommended Posts

  • 0

Hmmm try this, i can't see if it works because it doesn't flicker over here for me.

But make a new class file

paste this in it:

Public Class DoubleBufferRichTextBox

    Inherits System.Windows.Forms.RichTextBox

    Public Sub New()
        SetStyle(ControlStyles.DoubleBuffer, True)
        SetStyle(ControlStyles.AllPaintingInWmPaint, True)
    End Sub
    Public Event CustomPaint(ByVal e As PaintEventArgs)

    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)

        RaiseEvent CustomPaint(e)

    End Sub

End Class

I'm not sure if it would work, because someone helped me out once with this, because my gradients inside a panel was flickering on resize, but Double Buffering had fixed this issue, not sure if it would work on Textboxes.

So once you've made that class above

go into the form where the actual RichTextBox control works

and where the Windows Form Generated Code is

look for where the RichTextBox is instantiated

i.e. should be something like

richTextBox = new System.Windows.Forms.RichTextBox

and just change it to

richTextBox = new DoubleBufferRichTextBox

  • 0
  bangbang023 said:
well I do but even when I disable it, still the same thing. I actually created a vanialla blank app with a rich text box and the same thing happens.

584840882[/snapback]

This may sound dumb but, are you using a custom visual style?

I don't know because it seems like it's only happening to you, you can't eliminate the possibilities which might be causing this issue, have u tried sending the exe to a friend to see if they experience the same problem?

  • 0

Hm I can also see the flicker.. probably because I have a crap video card :p (It's only noticable when theres a large amount of text though).. I'll have a look and see if I can find a solution :p

Dan

EDIT: I took a look and it doesnt seem as though you can do much about this as the framework isnt actually drawing the richtextbox. :(.. I guess if the flickering is that big a problem then you will have to go back to the TextBox. :) (Hopfully I'm wrong :p)

Edited by dannyres
  • 0

Sorry, but most versions of RichEdit simply flicker. It's a poorly written control and the MS coders were too lazy to properly use a back buffer. It has nothing to do with monitor, video card, or refresh rate.

The only thing I can suggest is messing with the window styles for the parent window and the rich edit window itself.

WS_CLIPCHILDREN for the parent and WS_CLIPSIBLINGS for the rich edit.

As well, CS_HREDRAW and CS_VREDRAW should not be classed as class styles for RegisterClassEx.

Edited by vcv
  • 0
  vcv said:
Sorry, but most versions of RichEdit simply flicker.  It's a poorly written control and the MS coders were too lazy to properly use a back buffer.  It has nothing to do with monitor, video card, or refresh rate.

The only thing I can suggest is messing with the window styles for the parent window and the rich edit window itself.

WS_CLIPCHILDREN for the parent and WS_CLIPSIBLINGS for the rich edit.

As well, CS_HREDRAW and CS_VREDRAW should not be classed as class styles for RegisterClassEx.

584844295[/snapback]

I figured it had to be the control after all. Thanks.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Display Driver Uninstaller (DDU) 18.1.1.5 by Razvan Serea Display Driver Uninstaller (DDU) is a utility for completely removing AMD/NVIDIA/INTEL graphics drivers and related packages from your system, attempting to eliminate all leftovers (including registry entries, folders and files, driver store). Though AMD/NVIDIA/INTEL drivers can usually be removed via the Windows Control Panel, this uninstaller tool was created for situations where standard uninstall fails, or when you need to fully remove NVIDIA or ATI graphics card drivers. After using this driver cleaner, your system will behave as though it’s the first time you’re installing a new driver—similar to a fresh Windows installation. As with all such tools, we recommend creating a restore point beforehand, allowing you to undo changes if issues arise. If you're having trouble installing an older or newer driver, try it—there are reports that it resolves such problems. Recommended usage: The tool can be used in Normal mode but for absolute stability when using DDU, Safemode is always the best. Make a backup or a system restore (but it should normally be pretty safe). It is best to exclude the DDU folder completely from any security software to avoid issues. You do NOT need to uninstall the driver prior using DDU. Requirements: .NET Framework 4.8 Compatible with Windows 7, 8, 8.1, 10, and 11 (32-bit or 64-bit) Note: Using on Insider Preview builds is at your own risk. Display Driver Uninstaller (DDU) 18.1.1.5 changelog: Intel: Added NPU presence detection before removing shared DLL files (these were previously left to prevent potential NPU-related issues). Intel: Added optional NPU removal Improved "Extension" driver removal process. Updated several translations. Download: Display Driver Uninstaller 18.1.1.5 | 1.7 MB (Freeware) Download: DDU Portable | 1.2 MB Links: Display Driver Uninstaller Home Page | Screenshot | Forum Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I just ordered a new MSI X870 board, hasn't even arrived yet. I checked the downloads page, and it has the firmware released on 6/11/2025 including the updated AGESA code.
    • There used to be an independent video game store in West Edmonton Mall around 20 years ago, I'm not sure when it went out of business, but they were selling console & PC games for $70±, I think it was so they could cover their rent!
    • That adverting your referring to can basically be turned off with a few Windows settings. The only advertising I've seen in the last couple of years on Windows 11 is Outlook ads because I don't have a Microsoft 365 subscription. That said, it took me only a couple days to get used to ignoring those ads. I would prefer they weren't there but it's not a big deal.
    • Petty nerd sums up many peoples dislike for things. i.e. Windows 11
  • Recent Achievements

    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
    • First Post
      CSpera earned a badge
      First Post
    • One Month Later
      MIR JOHNNY BLAZE earned a badge
      One Month Later
    • Apprentice
      Wireless wookie went up a rank
      Apprentice
  • Popular Contributors

    1. 1
      +primortal
      634
    2. 2
      ATLien_0
      275
    3. 3
      +FloatingFatMan
      180
    4. 4
      Michael Scrip
      152
    5. 5
      Steven P.
      116
  • Tell a friend

    Love Neowin? Tell a friend!