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) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ItemDragEventArgs コンストラクタ (MouseButtons)

マウス ボタン指定して、ItemDragEventArgs クラス新しインスタンス初期化します。

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

Public Sub New ( _
    button As MouseButtons _
)
Dim button As MouseButtons

Dim instance As New ItemDragEventArgs(button)
public ItemDragEventArgs (
    MouseButtons button
)
public:
ItemDragEventArgs (
    MouseButtons button
)
public ItemDragEventArgs (
    MouseButtons button
)
public function ItemDragEventArgs (
    button : MouseButtons
)

パラメータ

button

押されマウス ボタンを示す MouseButtons 値のビットごとの組み合わせ

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ItemDragEventArgs コンストラクタ (MouseButtons, Object)

マウス ボタン、およびドラッグされている項目を指定して、ItemDragEventArgs クラス新しインスタンス初期化します。

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

Public Sub New ( _
    button As MouseButtons, _
    item As Object _
)
Dim button As MouseButtons
Dim item As Object

Dim instance As New ItemDragEventArgs(button,
 item)
public ItemDragEventArgs (
    MouseButtons button,
    Object item
)
public:
ItemDragEventArgs (
    MouseButtons button, 
    Object^ item
)
public ItemDragEventArgs (
    MouseButtons button, 
    Object item
)
public function ItemDragEventArgs (
    button : MouseButtons, 
    item : Object
)

パラメータ

button

押されマウス ボタンを示す MouseButtons 値のビットごとの組み合わせ

item

ドラッグされている項目。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ItemDragEventArgs コンストラクタ

ItemDragEventArgs クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
ItemDragEventArgs (MouseButtons) マウス ボタン指定してItemDragEventArgs クラス新しインスタンス初期化します。
ItemDragEventArgs (MouseButtons, Object) マウス ボタン、およびドラッグされている項目を指定してItemDragEventArgs クラス新しインスタンス初期化します。
参照参照

関連項目

ItemDragEventArgs クラス
ItemDragEventArgs メンバ
System.Windows.Forms 名前空間

ItemDragEventArgs プロパティ


ItemDragEventArgs メソッド


ItemDragEventArgs メンバ

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

ItemDragEventArgs データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ItemDragEventArgs オーバーロードされます。 ItemDragEventArgs クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ItemDragEventArgs クラス
System.Windows.Forms 名前空間



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

辞書ショートカット

すべての辞書の索引

「ItemDragEventArgs」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS