ItemDragEventArgs クラスとは? わかりやすく解説

ItemDragEventArgs クラス

ListView コントロールと TreeView コントロールの ItemDrag イベントデータ提供します

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

<ComVisibleAttribute(True)> _
Public Class ItemDragEventArgs
    Inherits EventArgs
Dim instance As ItemDragEventArgs
[ComVisibleAttribute(true)] 
public class ItemDragEventArgs : EventArgs
[ComVisibleAttribute(true)] 
public ref class ItemDragEventArgs : public
 EventArgs
/** @attribute ComVisibleAttribute(true) */ 
public class ItemDragEventArgs extends EventArgs
ComVisibleAttribute(true) 
public class ItemDragEventArgs extends
 EventArgs
解説解説

ItemDrag イベントは、ユーザーが項目のドラッグ開始する発生しますItemDragEventArgs オブジェクトは、どちらのマウス ボタン押されたかを示します

使用例使用例

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.Object
   System.EventArgs
    System.Windows.Forms.ItemDragEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「ItemDragEventArgs クラス」の関連用語

ItemDragEventArgs クラスのお隣キーワード
検索ランキング

   

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



ItemDragEventArgs クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS