public ListBoxDragDropHelper(ListBox draglistbox, ListBox droplistbox, DListBoxDragDropHelperEventListener ondrop)
 {
     if (draglistbox == null || droplistbox == null)
     {
         throw new Exception("Null listbox");
     }
     if (draglistbox.FindForm() != droplistbox.FindForm())
     {
         throw new Exception("ListBox not on same form");
     }
     DragListBox                    = draglistbox;
     DropListBox                    = droplistbox;
     OnDrop                         = ondrop;
     DragListBox.MouseDown         += DragListBox_MouseDown;
     DragListBox.MouseMove         += DragListBox_MouseMove;
     DragListBox.MouseUp           += DragListBox_MouseUp;
     DragListBox.QueryContinueDrag += DragListBox_QueryContinueDrag;
     DragListBox.GiveFeedback      += DragListBox_GiveFeedback;
     DropListBox.DragOver          += DropListBox_DragOver;
     DropListBox.DragDrop          += DropListBox_DragDrop;
     DropListBox.DragLeave         += DropListBox_DragLeave;
 }
 public ListBoxDragDropHelper(ListBox draglistbox, ListBox droplistbox, DListBoxDragDropHelperEventListener ondrop)
 {
     if (draglistbox == null || droplistbox == null)
     {
         throw new Exception("Null listbox");
     }
     if (draglistbox.FindForm() != droplistbox.FindForm())
     {
         throw new Exception("ListBox not on same form");
     }
     DragListBox = draglistbox;
     DropListBox = droplistbox;
     OnDrop = ondrop;
     DragListBox.MouseDown += DragListBox_MouseDown;
     DragListBox.MouseMove += DragListBox_MouseMove;
     DragListBox.MouseUp += DragListBox_MouseUp;
     DragListBox.QueryContinueDrag += DragListBox_QueryContinueDrag;
     DragListBox.GiveFeedback += DragListBox_GiveFeedback;
     DropListBox.DragOver += DropListBox_DragOver;
     DropListBox.DragDrop += DropListBox_DragDrop;
     DropListBox.DragLeave += DropListBox_DragLeave;
 }
예제 #3
0
 public ListBoxDragDropHelper(ListBox draglistbox, ListBox droplistbox,
                              DListBoxDragDropHelperEventListener ondrop)
     : this(draglistbox, droplistbox, ondrop, typeof(ListBox))
 {
 }