|
-
December 21st, 2003, 04:15 PM
#1
Flicker In TabControl
Okay, so I want to use the native .Net TabControl in one of my apps, but it flickers like crazy during resize. So I've been attempting to find a resolution.
I found a lot of chatter on the newsgroups about using double-bufferring by deriving a class from TabControl and then using this code:
Code:
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
Well, that didn't work. The control wouldn't even paint to the screen, even after I overrode OnPaint and passed it back to the base. I saw some postings that said I couldn't override OnPaint when using ControlStyles like DoubleBuffer, but I didn't investigate further.
I then read an article about getting rid of flicker in the ListView control by overriding WndProc. So I tried this code:
Code:
protected override void WndProc(ref Message messg)
{
if ((int)WM.WM_ERASEBKGND == messg.Msg)
messg.Msg = (int) WM.WM_NULL;
base.WndProc(ref messg);
}
That got rid of the flicker, but I get garbage around the border of the control. I would be very grateful if anyone could provide some assistance on this matter.
Thanks!
Colin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|