This topic has not yet been rated - Rate this topic

ControlDesigner.WndProc Method

Processes Windows messages and optionally routes them to the control.

Namespace:  System.Windows.Forms.Design
Assembly:  System.Design (in System.Design.dll)
protected virtual void WndProc(
	ref Message m
)

Parameters

m
Type: System.Windows.Forms.Message%
The Message to process.

This method is called for each message the control would usually receive. This allows the designer to preprocess messages before optionally routing them to the control.

To send the message to the control’s Control.WndProc method, call WndProc on the control's designer.

Note Note

The designer filters messages, so some messages will not be sent to the control. For example, mouse messages are intercepted by the designer. If this is not the behavior you want, call DefWndProc instead.

Pass m as a parameter. Optionally, you can alter or create a new System.Windows.Forms.Message to pass to the control's method.

The following table shows the flow of messages.

Without a designer

With a designer

USER32

Control.WndProc

Control.DefWndProc

USER32

USER32

Control.Designer. WndProc

DefWndProc

Control.WndProc

Control.DefWndProc

USER32

The designer intercepts messages by replacing the Control.WindowTarget property on the control. Usually, WindowTarget points to the NativeWindow contained within the control. During design time, the designer replaces this with its own window target, and caches the original value.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ