Avoid flicker in WindowsForms

  • Thread starter Thread starter Kumaran619
  • Start date Start date
K

Kumaran619

Guest
Hi All,

I have usecontrol similar to TabControl. I have added many child controls in each TabPages of the usercontrol. On changing the selected Tab, the TabControl flickers. I have also see this same behavior in Standard TabControl.

Initially I have tried to avoid the flickering using Doublebuffered. This doesnt seems to resolve the issue. We have also used tried below code example.

Code Example[C#]:

SetStyle(ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true)


But this cases didnt resolved the flickering issue. Finally we have tried the CreateParams as shown below.


protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams; cp.ExStyle |= 0x02000000;
return cp;
}
}





This resolved the flickering issue, but cause the painting issues with some child controls. Could anyone guide me how to resolve the flickering issue without using CreateParams? Because this CreateParams cause many side effects in the application.

Continue reading...
 
Back
Top