Hi all,

It seems that the OnPaint method is not called correctly on UserControls
when using double buffering.

See code below: if the two lines are uncommented, the "control painted"
text is not shown after minimizing/maximizing for instance.  Without
double buffering the text is shown correctly.

Is this a known issue? If not, I'll file a bug report ...

public class MyControl : UserControl
    {
        public MyControl()
        {
            this.Size = new Size(100, 100);
            this.BackColor = Color.Green;

            //SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // do
double buffering
            //SetStyle(ControlStyles.AllPaintingInWmPaint, true);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            Console.WriteLine("control painted");
        }
    }

Bart
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to