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 _
protected virtual void OnPaintBackground(
 PaintEventArgs pevent
protected: virtual void OnPaintBackground(
 PaintEventArgs* pevent
protected function OnPaintBackground(
   pevent : PaintEventArgs


A PaintEventArgs that contains information about the control to paint.


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.


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

© 2015 Microsoft