I am having an application which shows the data (stock market) in an user control made by me. In my application, there may be more than one user control on single screen to analyse multiple stocks. Given that functionality, user can move from 1 control to multiple control on screen. This functionality was giving flickering issue. To solve flickering issue I used double buffering which was enabled by below code -
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
return cp;
}
}
This above code definitely helped to remove flickering issue. But created another issue which is - Sometimes it gives a black window in that user control. Everything I found perfect in the code flow but could not find out the reason for this black window.
Removing double buffering gives proper output but again the flickering comes into picture.
Here is an image for you better understanding of issue -