Called when the control designer draws the associated control on the design surface, if the CustomPaint value is true.
Assembly: System.Design (in System.Design.dll)
Protected Overridable Sub OnPaint ( _ e As [%$TOPIC/w4xsfa71_en-us_VS_110_2_0_0_0_0%] _ )
protected virtual void OnPaint( [%$TOPIC/w4xsfa71_en-us_VS_110_2_0_1_0_0%] e )
protected: virtual void OnPaint( [%$TOPIC/w4xsfa71_en-us_VS_110_2_0_2_0_0%]^ e )
abstract OnPaint : e:[%$TOPIC/w4xsfa71_en-us_VS_110_2_0_3_0_0%] -> unit override OnPaint : e:[%$TOPIC/w4xsfa71_en-us_VS_110_2_0_3_0_1%] -> unit
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 IControlDesignerViewViewEvent event. Classes deriving from ControlDesigner should set the ViewFlagsCustomPaint value and override the method to process events that are raised when the design host draws the control on the design surface.
The 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 method returns without performing any processing.Notes to Inheritors
Override the 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 Using Libraries from Partially Trusted Code.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.