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.

注解

OnNotifyMessage仅当调用方法的控件EnableNotifyMessage中设置样式位ControlStylesThe OnNotifyMessage method is called if the control's EnableNotifyMessage style bit is set in ControlStyles. EnableNotifyMessage设置中的样式ControlStyles使得控件可以时得到通知WndProc方法接收 Windows 消息。The 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.

适用于