Designer. Wnd Proc(Message) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Processes Windows messages and optionally routes them to the control.
protected: virtual void WndProc(System::Windows::Forms::Message % m);
protected virtual void WndProc (ref System.Windows.Forms.Message m);
abstract member WndProc : Message -> unit override this.WndProc : Message -> unit
Protected Overridable Sub WndProc (ByRef m As Message)
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.
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.
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|
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.