ToolStripItem.DragDrop イベント
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

public: event DragEventHandler^ DragDrop { void add (DragEventHandler^ value); void remove (DragEventHandler^ value); }


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; } }

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


Weblioに収録されているすべての辞書からToolStripItem.DragDrop イベントを検索する場合は、下記のリンクをクリックしてください。

- ToolStripItem.DragDrop イベントのページへのリンク