bangbang023 Veteran Posted October 31, 2004 Veteran Share Posted October 31, 2004 I have a rich text box control and I noticed, when typing, the contents flicker a bit. This doesn't happen in a plain textbox. Any ideas? Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/ Share on other sites More sharing options...
0 Winston Posted October 31, 2004 Share Posted October 31, 2004 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 Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584836825 Share on other sites More sharing options...
0 bangbang023 Veteran Posted October 31, 2004 Author Veteran Share Posted October 31, 2004 thanks I will try it in a bit and get back to you Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584838230 Share on other sites More sharing options...
0 bangbang023 Veteran Posted October 31, 2004 Author Veteran Share Posted October 31, 2004 nope, it still flickers when typing in the box. I may just have to go back to a plain tetx box and forget some of the advanced features of the rich text box Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584838365 Share on other sites More sharing options...
0 todd Posted October 31, 2004 Share Posted October 31, 2004 Do you have any code triggering when text is typed into the box? Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584839948 Share on other sites More sharing options...
0 bangbang023 Veteran Posted October 31, 2004 Author Veteran Share Posted October 31, 2004 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. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584840882 Share on other sites More sharing options...
0 Winston Posted November 1, 2004 Share Posted November 1, 2004 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? Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841169 Share on other sites More sharing options...
0 bangbang023 Veteran Posted November 1, 2004 Author Veteran Share Posted November 1, 2004 Good idea but nope that didn't change anything. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841324 Share on other sites More sharing options...
0 lexecutil Posted November 1, 2004 Share Posted November 1, 2004 (edited) 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 November 1, 2004 by dannyres Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841454 Share on other sites More sharing options...
0 bangbang023 Veteran Posted November 1, 2004 Author Veteran Share Posted November 1, 2004 damn that really sucks and yes the flickering is a huge problem for me. back to textbox it is :( Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841662 Share on other sites More sharing options...
0 Winston Posted November 1, 2004 Share Posted November 1, 2004 bangbang023 said: damn that really sucks and yes the flickering is a huge problem for me. back to textbox it is :( 584841662[/snapback] can i see this flicker post a sample exe please. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841755 Share on other sites More sharing options...
0 bangbang023 Veteran Posted November 1, 2004 Author Veteran Share Posted November 1, 2004 just download nexpad 0.3 from my sig. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841783 Share on other sites More sharing options...
0 Winston Posted November 1, 2004 Share Posted November 1, 2004 very subtle flickering, strange, it doesnt happen to me, u must be doing something in the background. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841835 Share on other sites More sharing options...
0 bangbang023 Veteran Posted November 1, 2004 Author Veteran Share Posted November 1, 2004 nothing is going on in the background. Just my usual apps running, nothing that uses cpu much, just my IM programs. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584841934 Share on other sites More sharing options...
0 Winston Posted November 1, 2004 Share Posted November 1, 2004 LOL no no i meant inside the application, what events have you subscribed to in respect to the rich text box? Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584842741 Share on other sites More sharing options...
0 bangbang023 Veteran Posted November 1, 2004 Author Veteran Share Posted November 1, 2004 well i have the line number counter but that's it really. For testing, I disabled all events related to the text box that would be triggered automatically and still flickers. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584842749 Share on other sites More sharing options...
0 Winston Posted November 1, 2004 Share Posted November 1, 2004 hmmmm do u have a LCD? lol this sounds irrelevant but it took me a while till i finally saw the flickering, it only happened once in a blue moon. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584842761 Share on other sites More sharing options...
0 bangbang023 Veteran Posted November 1, 2004 Author Veteran Share Posted November 1, 2004 nope regular crt set at 85hz refresh. This is mind bloggling to me but the flickering drives me up the wall and back down again. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584842769 Share on other sites More sharing options...
0 vcv Posted November 1, 2004 Share Posted November 1, 2004 (edited) 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 November 1, 2004 by vcv Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584844295 Share on other sites More sharing options...
0 bangbang023 Veteran Posted November 2, 2004 Author Veteran Share Posted November 2, 2004 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. Link to comment https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/#findComment-584846810 Share on other sites More sharing options...
Question
bangbang023 Veteran
I have a rich text box control and I noticed, when typing, the contents flicker a bit. This doesn't happen in a plain textbox. Any ideas?
Link to comment
https://www.neowin.net/forum/topic/238139-vb-net-flicker-in-rich-text-box/Share on other sites
19 answers to this question
Recommended Posts