private void listBoxControl1_MouseMove(object sender, MouseEventArgs e) { ListBoxControl listBox = sender as ListBoxControl; if (e.Button == MouseButtons.Left) { if ((startPoint != Point.Empty) && ((Math.Abs(e.X - startPoint.X) > SystemInformation.DragSize.Width) || (Math.Abs(e.Y - startPoint.Y) > SystemInformation.DragSize.Height))) { listBox.DoDragDrop(listBox.SelectedItem, DragDropEffects.Copy); } } }
private void fieldsListBox_MouseMove(object sender, MouseEventArgs e) { ListBoxControl c = sender as ListBoxControl; if (e.Button == MouseButtons.Left) { if ((p != Point.Empty) && ((Math.Abs(e.X - p.X) > 5) || (Math.Abs(e.Y - p.Y) > 5))) { c.DoDragDrop(sender, DragDropEffects.Move); } } }