Behavior.OnMouseDoubleClick メソッド
アセンブリ: System.Design (system.design.dll 内)

Public Overridable Function OnMouseDoubleClick ( _ g As Glyph, _ button As MouseButtons, _ mouseLoc As Point _ ) As Boolean
Dim instance As Behavior Dim g As Glyph Dim button As MouseButtons Dim mouseLoc As Point Dim returnValue As Boolean returnValue = instance.OnMouseDoubleClick(g, button, mouseLoc)
- g
メッセージが処理された場合は true。それ以外の場合は false。

BehaviorService の装飾ウィンドウの WndProc にダブルクリック メッセージが渡されると OnMouseDoubleClick メソッドが呼び出されます。メッセージは、まず、ここで渡され、動作スタックの最上位の Behavior に伝えられます。このメソッドから true が返された場合、メッセージが Behavior によって処理され、処理を続行するべきではないことを意味します。メッセージは、ここから適切な動作へと送信されます。

ダブルクリック メッセージを処理する方法を次のコード例に示します。完全なコードの一覧については、「方法 : デザイン モードでコントロールの外観と動作を拡張する」を参照してください。
' 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
// 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 override bool OnMouseDoubleClick( Glyph g, MouseButtons button, Point mouseLoc) { base.OnMouseDoubleClick(g, button, mouseLoc); if (button == MouseButtons.Left) { AnchorGlyph ag = g as AnchorGlyph; PropertyDescriptor pdAnchor = TypeDescriptor.GetProperties(ag.relatedControl)["Anchor"]; if (ag.IsEnabled) { // The glyph is enabled. // Clear the AnchorStyle flag to disable the Glyph. pdAnchor.SetValue( ag.relatedControl, ag.relatedControl.Anchor ^ ag.anchorStyle ); } else { // The glyph is disabled. // Set the AnchorStyle flag to enable the Glyph. pdAnchor.SetValue( ag.relatedControl, ag.relatedControl.Anchor | ag.anchorStyle); } } return true; }


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からBehavior.OnMouseDoubleClick メソッドを検索する場合は、下記のリンクをクリックしてください。

- Behavior.OnMouseDoubleClick メソッドのページへのリンク