Wednesday, April 13, 2011

C#, WinForms: Why isn't OnPaintBackground called when I call Refresh()?

I just found a form which overrides OnPaintBackground. The weird thing is that it is never called! Like, at all. Why is this? The form is refreshed, moved, resized, etc, etc, so it should have to do some repainting right?

From stackoverflow
  • Does it have SetStyle(ControlStyles.UserPaint, True) set? Or, does it have a control with Dock set to Fill?

    Svish : There is no SetStyle UserPaint, or Dock Fill controls on the form. But it is an MdiParent, so I guess it has an MdiClient which is filling it.

0 comments:

Post a Comment