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

代表 Windows 訊息的 MessageA 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.

適用於