How to prevent UI flashing and other mass update distraction
Posted: Fri Feb 13, 2009 5:28 pm
I have multi-threaded application that interacts with TeeChart. Because of how we need to process the data that is generated, I add an remove many series's from the chart control. Some are visible others are not, some show in the legend, others do not. There is also some sizing of the chart that occurs because of some other controls I put around the chart. It is a very dynamic situation.
While this processing is going on and the data being charted is changing, I would like to chart to be flashing and changing making it distracting to the user. There are a couple of processing threads. 1 is generating the data and loops about 4 - 5 times. Each time coming up with a new set of data to chart. The other thread is consuming that data and mapping it to TeeChart series's and calculating Axes increments and labels and things of that sort.
I would like each iteration to have the chart draw the data ( add series, set axes labels, size the chart etc) without the user seeing the chart jump, flash, jerk, and other distracting behaviors.
I have tried calling SuspendLayout / ResumeLayout at various places but this does not seem to help. I have tried to do this on the chart and on the dialog that is the parent of the chart. Neither case helps.
Any thoughts on how to minimize or eliminate the UI distractions? Ideally it would be nice to freeze the drawing area until all data is in place in the chart and then have it completely redraw the chart one time. I did verify that the Graphics3D.UseBuffer = true;
While this processing is going on and the data being charted is changing, I would like to chart to be flashing and changing making it distracting to the user. There are a couple of processing threads. 1 is generating the data and loops about 4 - 5 times. Each time coming up with a new set of data to chart. The other thread is consuming that data and mapping it to TeeChart series's and calculating Axes increments and labels and things of that sort.
I would like each iteration to have the chart draw the data ( add series, set axes labels, size the chart etc) without the user seeing the chart jump, flash, jerk, and other distracting behaviors.
I have tried calling SuspendLayout / ResumeLayout at various places but this does not seem to help. I have tried to do this on the chart and on the dialog that is the parent of the chart. Neither case helps.
Any thoughts on how to minimize or eliminate the UI distractions? Ideally it would be nice to freeze the drawing area until all data is in place in the chart and then have it completely redraw the chart one time. I did verify that the Graphics3D.UseBuffer = true;