本文整理汇总了VB.NET中System.Windows.Forms.Design.Behavior.Behavior.OnMouseDoubleClick方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Behavior.OnMouseDoubleClick方法的具体用法?VB.NET Behavior.OnMouseDoubleClick怎么用?VB.NET Behavior.OnMouseDoubleClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Design.Behavior.Behavior
的用法示例。
在下文中一共展示了Behavior.OnMouseDoubleClick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: OnMouseDoubleClick
' When you double-click on an AnchorGlyph, the value of
' the control's Anchor property is toggled.
'
' Note that the value of the Anchor property is not set
' by direct assignment. Instead, the
' PropertyDescriptor.SetValue method is used. This
' enables notification of the design environment, so
' related events can be raised, for example, the
' IComponentChangeService.ComponentChanged event.
Public Overrides Function OnMouseDoubleClick( _
ByVal g As Glyph, _
ByVal button As MouseButtons, _
ByVal mouseLoc As Point) As Boolean
MyBase.OnMouseDoubleClick(g, button, mouseLoc)
If button = MouseButtons.Left Then
Dim ag As AnchorGlyph = g
Dim pdAnchor As PropertyDescriptor = _
TypeDescriptor.GetProperties(ag.relatedControl)("Anchor")
If ag.IsEnabled Then
' The glyph is enabled.
' Clear the AnchorStyle flag to disable the Glyph.
pdAnchor.SetValue(ag.relatedControl, _
ag.relatedControl.Anchor Xor ag.anchorStyle)
Else
' The glyph is disabled.
' Set the AnchorStyle flag to enable the Glyph.
pdAnchor.SetValue(ag.relatedControl, _
ag.relatedControl.Anchor Or ag.anchorStyle)
End If
End If
Return True
End Function