protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button == MouseButtons.Left) { if (whereMouseDown == MouseDownLocation.ItemArea || (mouseDownItemIndex != -1 && mouseDownClicks == 2)) { DoWhenLeftButtonUpInItemsArea(e.Location, mouseDownClicks); } whereMouseDown = MouseDownLocation.NotDown; } }
protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (e.Button == MouseButtons.Left) { mouseDownClicks = e.Clicks; if (e.Clicks == 1) { pointMouseDown = e.Location; whereMouseDown = CheckLocation(e.Location); mouseDownItemIndex = GetItemIndexFromPoint(e.Location); if (TopItemFullyShow) { if (mouseDownItemIndex == LastShowIndex && LastItemPartlyShow) isMouseDownInLastPartlyShowIndex = true; else isMouseDownInLastPartlyShowIndex = false; } if (whereMouseDown == MouseDownLocation.ItemArea) { if (ItemSelectionMode == ListSelectionMode.One) { DoWhenLeftButtonDownInItemsArea_One(e.Location); } else if (ItemSelectionMode == ListSelectionMode.Multiple) { lastMouseDownMoveItemIndex = GetItemIndexFromPoint(e.Location); DoWhenLeftButtonDownInItemsArea_Multi(e.Location); } } } } else { whereMouseDown = MouseDownLocation.NonLeftKeyDown; } }