Export (0) Print
Expand All
Expand Minimize

Control.OnPaintBackground Method

Paints the background of the control.

[Visual Basic]
Protected Overridable Sub OnPaintBackground( _
   ByVal pevent As PaintEventArgs _
)
[C#]
protected virtual void OnPaintBackground(
 PaintEventArgs pevent
);
[C++]
protected: virtual void OnPaintBackground(
 PaintEventArgs* pevent
);
[JScript]
protected function OnPaintBackground(
   pevent : PaintEventArgs
);

Parameters

pevent
A PaintEventArgs that contains information about the control to paint.

Remarks

The OnPaintBackground method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors:  Inheriting classes should override this method to handle the erase background request from windows. When overriding OnPaintBackground in a derived class it is not necessary to call the base class's OnPaintBackground method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Control Class | Control Members | System.Windows.Forms Namespace | InvokePaintBackground

Show:
© 2015 Microsoft