private void ClipsDragOver(object sender, DragEventArgs e) { /*fIndexOfItemUnderMouseToDrop = listBoxClips.IndexFromPoint(listBoxClips.PointToClient(new Point(e.X, e.Y))); * * if (fIndexOfItemUnderMouseToDrop != ListBox.NoMatches) * { * listBoxClips.SelectedIndex = fIndexOfItemUnderMouseToDrop; * } * else * {*/ SelectedIndex = 0; //} /*if (e.Effect == DragDropEffects.Move) * listBoxClips.Items.Remove((string)e.Data.GetData(DataFormats.Text));*/ #if ADVANCED_DRAG_AND_DROP Point p = Cursor.Position; Win32Point wp; wp.x = p.X; wp.y = p.Y; IDropTargetHelper dropHelper = (IDropTargetHelper) new DragDropHelper(); dropHelper.DragOver(ref wp, (int)e.Effect); #endif }
public void Drag_Over(DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop) || e.Data.GetDataPresent("HTML Format") || e.Data.GetDataPresent(DataFormats.Text) || e.Data.GetDataPresent("UniformResourceLocator") ) { e.Effect = DragDropEffects.Copy; try { Point _p = Cursor.Position; Win32Point _wp; _wp.x = _p.X; _wp.y = _p.Y; IDropTargetHelper _dropHelper = (IDropTargetHelper) new DragDropHelper(); _dropHelper.DragOver(ref _wp, (int)e.Effect); } catch { } } else { e.Effect = DragDropEffects.None; // Unknown data, ignore it } }
/// <summary> /// Bring the Drag Icon visual at the mouse position /// </summary> public void UpdatePosition() { if (WPF.GetCursorPos(out WPF.SysPoint spos)) { DDHelper.DragOver(ref spos, Effects); } }
protected virtual void OnDragOver(DragEventArgs e, FrameworkElement element) { Win32Point wp; System.Windows.Point p = e.GetPosition(element); wp.x = (int)p.X; wp.y = (int)p.Y; _DropTargetHelper.DragOver(ref wp, (int)e.Effects); }
public static void ProcessDragOver(DragEventArgs e) { Point point = Cursor.Position; WindowsPoint winpoint; winpoint.X = point.X; winpoint.Y = point.Y; IDropTargetHelper dropHelper = (IDropTargetHelper) new DragDropHelper(); dropHelper.DragOver(ref winpoint, (int)e.Effect); }
protected void control_OnDragOver(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Copy; Point p = Cursor.Position; Win32Point wp; wp.x = p.X; wp.y = p.Y; IDropTargetHelper dropHelper = (IDropTargetHelper) new DragDropHelper(); dropHelper.DragOver(ref wp, (int)e.Effect); }
private void dataGridView1_DragOver(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Copy; Point p = Cursor.Position; Win32Point wp; wp.x = p.X; wp.y = p.Y; IDropTargetHelper dropHelper = (IDropTargetHelper) new DragDropHelper(); dropHelper.DragOver(ref wp, (int)e.Effect); }
protected override void OnDragOver(DragEventArgs e) { Win32Point wp; e.Effects = DragDropEffects.Copy; Point p = e.GetPosition(this); wp.x = (int)p.X; wp.y = (int)p.Y; IDropTargetHelper dropHelper = (IDropTargetHelper) new DragDropHelper(); dropHelper.DragOver(ref wp, (int)e.Effects); }
public int DragOver(ShellAPI.MK grfKeyState, ShellAPI.POINT pt, ref DragDropEffects pdwEffect) { bool reset = false; #region Get DropItem Point point = br.FileView.PointToClient(new Point(pt.x, pt.y)); ListViewHitTestInfo hitTest = br.FileView.HitTest(point); if (hitTest.Item != null && (br.FileView.View != View.Details || hitTest.SubItem == null || hitTest.Item.Name == hitTest.SubItem.Name) && (hitTest.Location == ListViewHitTestLocations.Image || hitTest.Location == ListViewHitTestLocations.Label || hitTest.Location == ListViewHitTestLocations.StateImage)) { if (!hitTest.Item.Equals(dropListItem)) { if (dropTarget != null) { dropTarget.DragLeave(); } ReleaseCom(); if (dropListItem != null) { dropListItem.Selected = wasSelected; } dropListItem = hitTest.Item; wasSelected = dropListItem.Selected; dropListItem.Selected = true; ShellItem item = (ShellItem)dropListItem.Tag; parentDropItem = item; ShellHelper.GetIDropTarget(item, out dropTargetPtr, out dropTarget); reset = true; } } else { if (dropListItem != null) { if (dropTarget != null) { dropTarget.DragLeave(); } ReleaseCom(); dropListItem.Selected = wasSelected; dropListItem = null; parentDropItem = br.SelectedItem; ShellHelper.GetIDropTarget(br.SelectedItem, out dropTargetPtr, out dropTarget); reset = true; } } #endregion if (dropTarget != null) { if (reset) { dropTarget.DragEnter(dropDataObject, grfKeyState, pt, ref pdwEffect); } else { dropTarget.DragOver(grfKeyState, pt, ref pdwEffect); } } else { pdwEffect = DragDropEffects.None; } if (dropHelper != null) { dropHelper.DragOver(ref pt, pdwEffect); } return(ShellAPI.S_OK); }
public int DragOver(ShellAPI.MK grfKeyState, ShellAPI.POINT pt, ref DragDropEffects pdwEffect) { bool reset = false; #region Get DropItem Point point = br.FolderView.PointToClient(new Point(pt.x, pt.y)); TreeViewHitTestInfo hitTest = br.FolderView.HitTest(point); if (!TreeNode.Equals(dropNode, hitTest.Node)) { if (dropTarget != null) { dropTarget.DragLeave(); } ReleaseCom(); dropNode = hitTest.Node; br.FolderView.SelectedNode = dropNode; if (dropNode == null) { pdwEffect = DragDropEffects.None; if (dropHelper != null) { dropHelper.DragOver(ref pt, pdwEffect); } return(ShellAPI.S_OK); } else { ShellItem item = (ShellItem)dropNode.Tag; parentDropItem = item; ShellHelper.GetIDropTarget(item, out dropTargetPtr, out dropTarget); reset = true; } } else if (dropNode == null) { if (dropTarget != null) { dropTarget.DragLeave(); } ReleaseCom(); dropNode = null; br.SelectedNode = null; pdwEffect = DragDropEffects.None; if (dropHelper != null) { dropHelper.DragOver(ref pt, pdwEffect); } return(ShellAPI.S_OK); } #endregion if (dropTarget != null) { if (reset) { dropTarget.DragEnter(dropDataObject, grfKeyState, pt, ref pdwEffect); } else { dropTarget.DragOver(grfKeyState, pt, ref pdwEffect); } } else { pdwEffect = DragDropEffects.None; } if (dropHelper != null) { dropHelper.DragOver(ref pt, pdwEffect); } return(ShellAPI.S_OK); }
/// <summary> /// Notifies the DragDropHelper that the current Control received /// a DragOver event. /// </summary> /// <param name="dropHelper">The DragDropHelper instance to notify.</param> /// <param name="cursorOffset">The current cursor's offset relative to the window.</param> /// <param name="effect">The accepted drag drop effect.</param> public static void DragOver(this IDropTargetHelper dropHelper, Point cursorOffset, DragDropEffects effect) { Win32Point pt = cursorOffset.ToWin32Point(); dropHelper.DragOver(ref pt, (int)effect); }
/// <summary> /// Notifies the DragDropHelper that the current Control received /// a DragOver event. /// </summary> /// <param name="cursorOffset">The current cursor's offset relative to the window.</param> /// <param name="effect">The accepted drag drop effect.</param> public static void DragOver(Point cursorOffset, DragDropEffects effect) { s_instance.DragOver(cursorOffset, effect); }
/// <summary> /// Notifies the DragDropHelper that the current Control received /// a DragOver event. /// </summary> /// <param name="cursorOffset">The current cursor's offset relative to the window.</param> /// <param name="effect">The accepted drag drop effect.</param> public static void DragOver(System.Drawing.Point cursorOffset, DragDropEffects effect) { Win32Point pt = SwfDragDropLibExtensions.ToWin32Point(cursorOffset); s_instance.DragOver(ref pt, (int)effect); }