WorkflowDesignerMessageFilter.OnMouseMove(MouseEventArgs) 方法
定义
当鼠标指针在对象边界内移动时发生。Occurs when the mouse pointer moves while within the bounds of an object.
protected:
virtual bool OnMouseMove(System::Windows::Forms::MouseEventArgs ^ eventArgs);
protected virtual bool OnMouseMove (System.Windows.Forms.MouseEventArgs eventArgs);
abstract member OnMouseMove : System.Windows.Forms.MouseEventArgs -> bool
override this.OnMouseMove : System.Windows.Forms.MouseEventArgs -> bool
Protected Overridable Function OnMouseMove (eventArgs As MouseEventArgs) As Boolean
参数
- eventArgs
- MouseEventArgs
一个 MouseEventArgs,包含有关事件的信息。A MouseEventArgs that contains information about the event.
返回
如果消息已处理,则为 true;否则为 false。true if the message is handled; otherwise, false.
示例
下面的代码示例演示如何重写 OnMouseMove 方法来返回滚动位置和 false,以便设计器结构中的其他组件可以处理此方法。The following code example shows how to override the OnMouseMove method to return the scroll position and to return false so that other components in the designer architecture can process the method.
此代码示例摘自 DesignerShell.cs 文件中的基本设计器宿主 SDK 示例。This code example is part of the Basic Designer Hosting SDK Sample from the DesignerShell.cs file. 有关详细信息,请参阅 基本设计器宿主。For more information, see Basic Designer Hosting.
protected override bool OnMouseMove(MouseEventArgs eventArgs)
{
//Allow other components to process this event by not returning true.
if (mouseDown)
{
workflowView.ScrollPosition = new Point(eventArgs.X, eventArgs.Y);
}
return false;
}
Protected Overrides Function OnMouseMove(ByVal eventArgs As System.Windows.Forms.MouseEventArgs) As Boolean
' Allow other components to process this event by not returning true.
If mouseDown Then
workflowView.ScrollPosition = New Point(eventArgs.X, eventArgs.Y)
End If
Return False
End Function
注解
当鼠标指针在对象边界内移动时发生 OnMouseMove。OnMouseMove occurs when the mouse pointer moves while within the bounds of an object.