protected override void OnDragEnter(DragEventArgs de) { base.OnDragEnter(de); this.insertIndex = InvalidIndex; this.lastMouseLoc = Point.Empty; this.primaryDragControl = null; DropSourceBehavior.BehaviorDataObject data = de.Data as DropSourceBehavior.BehaviorDataObject; if (data != null) { int primaryControlIndex = -1; this.dragControls = data.GetSortedDragControls(ref primaryControlIndex); this.primaryDragControl = this.dragControls[primaryControlIndex] as System.Windows.Forms.Control; } this.CreateMarginBoundsList(); }
/// /// /// Called in response to a drag enter for OLE drag and drop. This method is overriden /// so that we can forward the OnDragEnter event to the currently selected TabPage. /// protected override void OnDragEnter(DragEventArgs de) { // Check what we are dragging... If we are just dragging tab pages, // then we do not want to forward the OnDragXXX forwardOnDrag = false; DropSourceBehavior.BehaviorDataObject data = de.Data as DropSourceBehavior.BehaviorDataObject; if (data != null) { ArrayList dragControls; int primaryIndex = -1; dragControls = data.GetSortedDragControls(ref primaryIndex); if (dragControls != null) { for (int i = 0; i < dragControls.Count; i++) { if (!(dragControls[i] is Control) || (dragControls[i] is Control && !(dragControls[i] is TabPage))) { forwardOnDrag = true; break; } } } } else { // We must be dragging something off the toolbox, so forward the drag to the right tabpage. forwardOnDrag = true; } if (forwardOnDrag) { TabPageDesigner pageDesigner = GetSelectedTabPageDesigner(); if (pageDesigner != null) { pageDesigner.OnDragEnterInternal(de); } } else { base.OnDragEnter(de); } }
protected override void OnDragEnter(DragEventArgs de) { this.forwardOnDrag = false; DropSourceBehavior.BehaviorDataObject data = de.Data as DropSourceBehavior.BehaviorDataObject; if (data != null) { int primaryControlIndex = -1; ArrayList sortedDragControls = data.GetSortedDragControls(ref primaryControlIndex); if (sortedDragControls != null) { for (int i = 0; i < sortedDragControls.Count; i++) { if (!(sortedDragControls[i] is Control) || ((sortedDragControls[i] is Control) && !(sortedDragControls[i] is TabPage))) { this.forwardOnDrag = true; break; } } } } else { this.forwardOnDrag = true; } if (this.forwardOnDrag) { TabPageDesigner selectedTabPageDesigner = this.GetSelectedTabPageDesigner(); if (selectedTabPageDesigner != null) { selectedTabPageDesigner.OnDragEnterInternal(de); } } else { base.OnDragEnter(de); } }