protected OnPaintBackground ( PaintEventArgs e ) : void | ||
e | PaintEventArgs | |
return | void |
protected override void OnPaintBackground(PaintEventArgs e)
{
try
{
Color backColor = BackColor;
if (!useCustomBackColor)
{
if (Parent is MetroTile)
{
backColor = MetroPaint.GetStyleColor(Style);
}
else
{
backColor = MetroPaint.BackColor.Form(Theme);
}
}
if (backColor.A == 255)
{
e.Graphics.Clear(backColor);
return;
}
base.OnPaintBackground(e);
OnCustomPaintBackground(new MetroPaintEventArgs(backColor, Color.Empty, e.Graphics));
}
catch
{
Invalidate();
}
}