LineShape.OnPaint Method
Raises the Paint event.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
Protected Friend Overrides Sub OnPaint ( _
e As PaintEventArgs _
)
protected internal override void OnPaint(
PaintEventArgs e
)
protected public:
virtual void OnPaint(
PaintEventArgs^ e
) override
abstract OnPaint :
e:PaintEventArgs -> unit
override OnPaint :
e:PaintEventArgs -> unit
override function OnPaint(
e : PaintEventArgs
)
Parameters
- e
Type: System.Windows.Forms.PaintEventArgs
A PaintEventArgs that contains the event data.
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnPaint method also enables 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
When overriding OnPaint in a derived class, make sure to call the OnPaint method of the base class so that registered delegates receive the event.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks Namespace
Other Resources
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)
How to: Draw Lines with the LineShape Control (Visual Studio)