ItemDragEventArgs クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
使用例
TreeView 内のドラッグ アンド ドロップ操作が有効な場合の ItemDragEventArgs の使用例を次に示します。ドラッグしたノードがドラッグ先に移動されるかコピーされるかは、Button プロパティによって決まります。次に、Item プロパティによって表されているノードが、期待した効果を示す値と共に TreeView コントロールの DoDragDrop メソッドに渡されます。
詳細については、TreeView.ItemDrag のリファレンス トピックを参照してください。
Private Sub treeView1_ItemDrag(ByVal sender As Object, ByVal e As ItemDragEventArgs) ' Move the dragged node when the left mouse button is used. If e.Button = MouseButtons.Left Then DoDragDrop(e.Item, DragDropEffects.Move) ' Copy the dragged node when the right mouse button is used. ElseIf e.Button = MouseButtons.Right Then DoDragDrop(e.Item, DragDropEffects.Copy) End If End Sub 'treeView1_ItemDrag
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e) { // Move the dragged node when the left mouse button is used. if (e.Button == MouseButtons.Left) { DoDragDrop(e.Item, DragDropEffects.Move); } // Copy the dragged node when the right mouse button is used. else if (e.Button == MouseButtons.Right) { DoDragDrop(e.Item, DragDropEffects.Copy); } }
private: void treeView1_ItemDrag( Object^ /*sender*/, ItemDragEventArgs^ e ) { // Move the dragged node when the left mouse button is used. if ( e->Button == ::MouseButtons::Left ) { DoDragDrop( e->Item, DragDropEffects::Move ); } // Copy the dragged node when the right mouse button is used. else // Copy the dragged node when the right mouse button is used. if ( e->Button == ::MouseButtons::Right ) { DoDragDrop( e->Item, DragDropEffects::Copy ); } }
private void treeView1_ItemDrag(Object sender, ItemDragEventArgs e) { // Move the dragged node when the left mouse button is used. if (e.get_Button().Equals(get_MouseButtons().Left)) { DoDragDrop(e.get_Item(), DragDropEffects.Move); } // Copy the dragged node when the right mouse button is used. else { if (e.get_Button().Equals(get_MouseButtons().Right)) { DoDragDrop(e.get_Item(), DragDropEffects.Copy); } } } //treeView1_ItemDrag
System.EventArgs
System.Windows.Forms.ItemDragEventArgs
プラットフォーム
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
ItemDragEventArgs コンストラクタ (MouseButtons)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
解説
プラットフォーム
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
ItemDragEventArgs コンストラクタ (MouseButtons, Object)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
ItemDragEventArgs コンストラクタ
オーバーロードの一覧
名前 | 説明 |
---|---|
ItemDragEventArgs (MouseButtons) | マウス ボタンを指定して、ItemDragEventArgs クラスの新しいインスタンスを初期化します。 |
ItemDragEventArgs (MouseButtons, Object) | マウス ボタン、およびドラッグされている項目を指定して、ItemDragEventArgs クラスの新しいインスタンスを初期化します。 |
ItemDragEventArgs プロパティ
ItemDragEventArgs メソッド
パブリック メソッド
名前 | 説明 | |
---|---|---|
Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) | |
GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) | |
GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) | |
ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) | |
ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
名前 | 説明 | |
---|---|---|
Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) | |
MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
ItemDragEventArgs メンバ
ListView コントロールと TreeView コントロールの ItemDrag イベントのデータを提供します。
ItemDragEventArgs データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
パブリック プロパティ
パブリック メソッド
名前 | 説明 | |
---|---|---|
Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) | |
GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) | |
GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) | |
ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) | |
ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
名前 | 説明 | |
---|---|---|
Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) | |
MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
- ItemDragEventArgsのページへのリンク