I have been at this for a few days and it is driving me mad. I have a control that inherits from System.Windows.Forms.Panel and I'm trying to override OnPaint. It just plain, outright IGNORES it.
public class CollapsiblePanel : System.Windows.Forms.Panel
{
public CollapsiblePanel()
{
//
// Required for the Windows Form Designer
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
SetStyle
(
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint | ControlStyles.DoubleBuffer |
ControlStyles.ResizeRedraw | ControlStyles.Selectable ,
true
);
}
protected override void OnPaint(PaintEventArgs e)
{
// This never runs no matter what I try!
base.OnPaint(e);
}
}