ToolStripItem.DragDrop イベントとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ToolStripItem.DragDrop イベントの意味・解説 

ToolStripItem.DragDrop イベント

メモ : このイベントは、.NET Framework version 2.0新しく追加されたものです。

ユーザーが項目をドラッグし、マウス ボタン離したとき (つまり、項目がドロップされたとき) に発生します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Event DragDrop As
 DragEventHandler
Dim instance As ToolStripItem
Dim handler As DragEventHandler

AddHandler instance.DragDrop, handler
public event DragEventHandler DragDrop
public:
event DragEventHandler^ DragDrop {
    void add (DragEventHandler^ value);
    void remove (DragEventHandler^ value);
}
/** @event */
public void add_DragDrop (DragEventHandler
 value)

/** @event */
public void remove_DragDrop (DragEventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例

X プロパティおよび Y プロパティクライアントPoint変換する方法次のコード例示します。このコード例は、ToolStripRenderer クラストピック取り上げているコード例一部分です。

' This method defines the DragOver event behavior. 
Protected Overrides Sub
 OnDragOver(dea As DragEventArgs)
   MyBase.OnDragOver(dea)
   
   ' Get the ToolStripButton control 
   ' at the given mouse position.
   Dim p As New Point(dea.X,
 dea.Y)
   Dim item As ToolStripButton = CType(Me.GetItemAt(Me.PointToClient(p)),
 ToolStripButton)
   
   
   ' If the ToolStripButton control is the empty cell,
   ' indicate that the move operation is valid.
     If item Is Me.emptyCellButton
 Then
         ' Set the drag operation to indicate a valid move.
         dea.Effect = DragDropEffects.Move
     End If
 End Sub
// This method defines the DragOver event behavior. 
protected override void OnDragOver(DragEventArgs
 dea)
{
    base.OnDragOver(dea);

    // Get the ToolStripButton control 
    // at the given mouse position.
    Point p = new Point(dea.X, dea.Y);
    ToolStripButton item = this.GetItemAt(
        this.PointToClient(p)) as ToolStripButton;

    // If the ToolStripButton control is the empty cell,
    // indicate that the move operation is valid.
    if( item == this.emptyCellButton )
    {
        // Set the drag operation to indicate a valid move.
        dea.Effect = DragDropEffects.Move;
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「ToolStripItem.DragDrop イベント」の関連用語

ToolStripItem.DragDrop イベントのお隣キーワード
検索ランキング

   

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



ToolStripItem.DragDrop イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS