Behavior.OnMouseDoubleClick メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Behavior.OnMouseDoubleClick メソッドの意味・解説 

Behavior.OnMouseDoubleClick メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

BehaviorService の装飾ウィンドウダブルクリック メッセージ渡される呼び出されます。

名前空間: System.Windows.Forms.Design.Behavior
アセンブリ: 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)
public virtual bool OnMouseDoubleClick (
    Glyph g,
    MouseButtons button,
    Point mouseLoc
)
public:
virtual bool OnMouseDoubleClick (
    Glyph^ g, 
    MouseButtons button, 
    Point mouseLoc
)
public boolean OnMouseDoubleClick (
    Glyph g, 
    MouseButtons button, 
    Point mouseLoc
)
public function OnMouseDoubleClick (
    g : Glyph, 
    button : MouseButtons, 
    mouseLoc : Point
) : boolean

パラメータ

g

Glyph

button

クリックされたボタンを示す MouseButtons 値。

mouseLoc

クリック発生した位置

戻り値
メッセージ処理され場合trueそれ以外場合false

解説解説
使用例使用例

ダブルクリック メッセージ処理する方法次のコード例示します。完全なコードの一覧については、「方法 : デザイン モードコントロール外観動作拡張する」を参照してください

' 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;
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からBehavior.OnMouseDoubleClick メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からBehavior.OnMouseDoubleClick メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からBehavior.OnMouseDoubleClick メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Behavior.OnMouseDoubleClick メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Behavior.OnMouseDoubleClick メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS