ControlDesigner.OnPaint Method

Note: This method is new in the .NET Framework version 2.0.

Called when the control designer draws the associated control on the design surface, if the CustomPaint value is true.

Namespace: System.Web.UI.Design
Assembly: System.Design (in system.design.dll)

protected:
virtual void OnPaint (
	PaintEventArgs^ e
)
protected void OnPaint (
	PaintEventArgs e
)
protected function OnPaint (
	e : PaintEventArgs
)

Parameters

e

A PaintEventArgs that specifies the graphics and rectangle boundaries used to draw the control.

The ViewEvent event is raised by the design host for certain actions on a control in the design surface. For example, an event is raised for the following conditions:

  • The user clicks the control.

  • The design host requests HTML markup to render the associated control on the design surface.

  • The user enters or exits template editing mode for the control.

The ControlDesigner class supplies a default delegate to handle the IControlDesignerView.ViewEvent event. Classes deriving from the ControlDesigner should set the ViewFlags.CustomPaint value and override the OnPaint method to process events that are raised when the design host draws the control on the design surface.

The OnPaint 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.

The default implementation of the OnPaint method returns without performing any processing.

Notes to Inheritors Override the OnPaint method in a class deriving from the ControlDesigner class to handle paint events for a control in the design surface. However, the event occurs only if the CustomPaint value has been set with the SetViewFlags method.

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: