private void BuildStepList_MouseUp(object sender, MouseEventArgs e) { ListViewHitTestInfo HitTest = BuildStepList.HitTest(e.X, e.Y); if (HitTest.Item != null && HitTest.SubItem != null) { int ColumnIndex = HitTest.Item.SubItems.IndexOf(HitTest.SubItem); if (ColumnIndex >= 1 && ColumnIndex <= 3) { BuildStep Task = (BuildStep)HitTest.Item.Tag; if (ColumnIndex == 1) { Task.bNormalSync ^= true; } else if (ColumnIndex == 2) { Task.bScheduledSync ^= true; } else { Task.bShowAsTool ^= true; } BuildStepList.Invalidate(HitTest.SubItem.Bounds); } } if (MouseDownSubItem != null) { BuildStepList.Invalidate(MouseDownSubItem.Bounds); MouseDownSubItem = null; } }
private void BuildStepList_MouseDown(object sender, MouseEventArgs e) { ListViewHitTestInfo HitTest = BuildStepList.HitTest(e.X, e.Y); MouseDownSubItem = HitTest.SubItem; if (MouseDownSubItem != null) { BuildStepList.Invalidate(MouseDownSubItem.Bounds, true); } }