HandledMouseEventArgs.Handled 属性

定义

获取或设置是否应将此事件转发到控件的父容器。

public:
 property bool Handled { bool get(); void set(bool value); };
public bool Handled { get; set; }
member this.Handled : bool with get, set
Public Property Handled As Boolean

属性值

Boolean

如果鼠标事件应转到父控件,则为 true;否则为 false

示例

下面的代码示例演示如何将鼠标滚轮事件标记为在自定义控件中处理。

Public Class MouseWheelControl
    Sub New()
        ' Add initialization code for the control here. 
    End Sub

    Protected Sub MouseWheelControl_MouseWheel(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Me.MouseWheel
        Dim Hme As HandledMouseEventArgs = e
        Hme.Handled = True
        ' Perform custom mouse wheel action here. 
    End Sub
End Class

适用于