处理键盘消息。
命名空间:System.Windows.Forms
程序集:System.Windows.Forms(在 system.windows.forms.dll 中)
Protected Friend Overridable Function ProcessKeyMessage ( _
ByRef m As Message _
) As Boolean
Dim m As Message
Dim returnValue As Boolean
returnValue = Me.ProcessKeyMessage(m)
protected internal virtual bool ProcessKeyMessage (
ref Message m
)
protected public:
virtual bool ProcessKeyMessage (
Message% m
)
protected boolean ProcessKeyMessage (
/** @ref */ Message m
)
参数
- m
通过引用传递的 Message,它表示要处理的窗口消息。
返回值
如果消息已由控件处理,则为 true;否则为 false。
在控件收到键盘消息时调用此方法。此方法首先确定控件是否有父级;如果有,它调用父级的 ProcessKeyPreview 方法。如果父级的 ProcessKeyPreview 方法不处理该消息,那么调用 ProcessKeyEventArgs 方法,以生成适当的键盘事件。m 参数包含必须处理的窗口消息。Message.Msg 属性的可能的值有 WM_CHAR、WM_KEYDOWN、WM_SYSKEYDOWN、WM_KEYUP 和 WM_SYSKEYUP。
给继承者的说明
在重写 ProcessKeyMessage 方法时,控件应返回 true 以指示它已经处理该键。对于未由控件处理的键,应返回基类的 ProcessKeyEventArgs 的结果。控件很少需要重写此方法(即使有的话)。
Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
.NET Framework
受以下版本支持:2.0、1.1、1.0