Control.OnNotifyMessage(Message) Control.OnNotifyMessage(Message) Control.OnNotifyMessage(Message) Control.OnNotifyMessage(Message) Method

定义

向控件通知 Windows 消息。Notifies the control of Windows messages.

protected:
 virtual void OnNotifyMessage(System::Windows::Forms::Message m);
protected virtual void OnNotifyMessage (System.Windows.Forms.Message m);
abstract member OnNotifyMessage : System.Windows.Forms.Message -> unit
override this.OnNotifyMessage : System.Windows.Forms.Message -> unit
Protected Overridable Sub OnNotifyMessage (m As Message)

参数

m
Message Message Message Message

一个 Message,它表示 Windows 消息。A Message that represents the Windows message.

注解

如果在中EnableNotifyMessage OnNotifyMessage 设置了控件的样式位,ControlStyles则调用方法。The OnNotifyMessage method is called if the control's EnableNotifyMessage style bit is set in ControlStyles. WndProcEnableNotifyMessage 的样式使控件能够在方法收到Windows消息时得到通知。ControlStylesThe EnableNotifyMessage style in ControlStyles enables the control to be notified when the WndProc method receives a Windows message. 利用此方法,不完全受信任的控件可以侦听 Windows 消息,而无需使消息修改消息。With this method, semi-trusted controls can listen for Windows messages without enabling them to modify the message.

继承者说明

当在OnNotifyMessage(Message)派生类中重写时,不需要调用OnNotifyMessage(Message)基类的方法,因为没有初始实现。When overriding OnNotifyMessage(Message) in a derived class, calling the base class's OnNotifyMessage(Message) method is not necessary because there is no initial implementation.

适用于