• 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

    • Perplexity starts testing its Comet AI browser on Windows by Usama Jawad AI is all the rage these days with Microsoft heavily pushing Copilot, Google investing its efforts in Gemini and Veo, Apple still figuring out Apple Intelligence, and OpenAI continuing to dominate the headlines. Now, another player in this space, Perplexity, has decided that it wants a bigger chunk of the market too. We already know that Perplexity is interested in the browser market. In May, it rolled out a version of its AI browser, Comet, exclusively to Mac customers running Apple Silicon. As expected, this piece of software features AI capabilities front and center, including the ability to engage in conversations with the AI model in natural language, surface emails that you haven't responded to, and a "Try on" feature that enables users to upload a picture of themselves and then see AI-generated images of themselves with different pieces of clothing, just to get an idea of how aesthetic they could look if they wear certain garments. Now, Perplexity CEO Aravind Srinivas has posted on X (formerly Twitter) that testing for the Windows version of Comet has now begun: Now that the testing for Comet on Windows has begun with a handful of testers, it will be interesting to see when the browser will roll out generally to customers and what feature set will eventually become available for the masses. That said, it is important to note that AI browser is not a novel concept; Opera Neon was recently announced as the first "AI agentic" browser. On a side note, Perplexity has been in hot waters recently. It received backlash from people after it revealed plans to find out everything its customers do online so that it can present them hyper-personalized ads. UK news outlet BBC also threatened the firm with legal action over its content scraping practices. Via: Engagdet
    • probably because these will be a minority compared to our general tech coverage, plus these stories, their premises do seem quite interesting.
    • Will Indian government upgrade my PC to Windows 11 if it's not supported? If they can't they should've mentioned alternatives as well.
  • Recent Achievements

    • First Post
      Brett76 earned a badge
      First Post
    • One Year In
      78andyp earned a badge
      One Year In
    • One Month Later
      Cottonbud earned a badge
      One Month Later
    • One Month Later
      langat earned a badge
      One Month Later
    • One Month Later
      Nullun earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      598
    2. 2
      ATLien_0
      219
    3. 3
      Michael Scrip
      197
    4. 4
      +FloatingFatMan
      144
    5. 5
      Xenon
      135
  • Tell a friend

    Love Neowin? Tell a friend!