Windows Develop Bookmark and Share   
 index > Windows Forms General > getting rid of textbox "flicker"
 

getting rid of textbox "flicker"

I have a textbox that I constantly update. And to do so i use:

textConsole.Text = message; //message is the string i want to set it to
textConsole.Select(textConsole.Text.Length, 0);
textConsole.ScrollToCaret();

But it updates too often that it flickers when it is updated. I know about the AppendText() method but for what I am doing I havent yet found a way to use it properly (im still trying).

So if anyone knows if it is possible to reduce the flicker let me know

Thanks
Fradam  Friday, January 26, 2007 3:08 PM

Hello,

While I have not done what you are doing I have had a listbox flicker at times in an application I made if I try to make several item updates at the same time. I do not know if this will work or not for you but, I put in a 'Application.DoEvents()' after each update. This forces the application to wait for the message pumps to empty before continuing. In my experience this has not caused any noticable slowdown for me (a speed rating application clocked a 15-20ms slowdown in response times) and, was able to stop flicker.

Again, I do not know if this will work for you but, I suppose its worth a try?

Phillip

Quilnux  Friday, January 26, 2007 3:18 PM

It may help to call SuspendLayout() before you do your updates to the textbox then call ResumeLayout() afterwards.

nahguam  Friday, January 26, 2007 3:33 PM
Thanks, but it didnt work. I think the only way I will be able to solve it is to change how I am doing everything. Which I really dont want to do but I dont think I have much of a choice at this point.
Fradam  Friday, January 26, 2007 3:35 PM
nahguam wrote:

It may help to call SuspendLayout() before you do your updates to the textbox then call ResumeLayout() afterwards.

Just for my understanding, what does that do?

Quilnux

Quilnux  Friday, January 26, 2007 4:37 PM

SuspendLayout() stops the controls from being repainted. ie changed.

ResumeLayout() allows painting to continue.

nahguam  Friday, January 26, 2007 4:47 PM

I see.

Thanks,

Quilnux

Quilnux  Saturday, January 27, 2007 2:30 PM

You can use google to search for other answers

Custom Search

More Threads

• squareroot thing in Windows forms
• Way to detect non alphabet font types for display in a control
• Printing a DataGridView in a pdf file in code
• dsoframer 1.3 paint issue with word 2007
• MDIParent Problems
• Disable Keyboard activity
• contextmenustrip - submenu image margin disbale
• ListView Mouse button Up
• windows product activation
• What is a ComboBox Items Data Type?