To solve a flickering issue, I resorted to using WS_EX_COMPOSITED
in a winforms app. This works perfectly until a tab control gains so many tabs that it creates the "Scroll arrows." At this point, my entire application looks like its redrawing constantly with shimmering and flickering everywhere.
To see if it was just my app, I wrote a simple winforms program to test it. All it contains is a tab control with a button that adds a tab, and the form its on has WS_EX_COMPOSITED
enabled... And sure enough, flickering happens when I click the add button and the scroll arrows appear.
Multiline tab control fixes this, but I don't have room in the app to use that. The code is really simple for my test app... Just added a tab page an a button, then in the form did:
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
return cp;
}
}
private void button1_Click(object sender, EventArgs e)
{
this.tabControl1.TabPages.Add("SomeTab");
}
I'm running win7 if that matters.
Have a look at the answer to this question flicker free tab control with WS_EX_COMPOSITED
May take a bit to work around but it should help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With