Avoid flickering in C# custom control
Whent it is set BackgroundImage to custom control and Invalidate is call you can see flickering. To avoid that try like this:
publicpartial class MyControl: UserControl
{
public MyControl()
{
SetStyle(ControlStyles.AllPaintingInWmPaint ControlStyles.OptimizedDoubleBuffer, true);
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}
}
3 comments:
Great!! That's what I was looking for...
THX for this hint
Amazing,it works :D
Works like a charm!
I added ControlStyles.UserPaint though, because it said so...
Post a Comment