public void MarkControl(ListViewItem yourItem, Color yourColor, int yourShowTick) { if (yourItem != null) { if (remindItemDc.ContainsKey(yourItem)) { remindItemDc[yourItem] = new RemindControlInfo(yourShowTick, remindItemDc[yourItem].OriginColor); } else { remindItemDc.Add(yourItem, new RemindControlInfo(yourShowTick, yourItem.BackColor)); } yourItem.BackColor = yourColor; } }
public void MarkControl(Control yourControl, Color yourColor, int yourShowTick) { if (yourControl != null) { if (remindControlDc.ContainsKey(yourControl)) { remindControlDc[yourControl] = new RemindControlInfo(yourShowTick, remindControlDc[yourControl].OriginColor); } else { remindControlDc.Add(yourControl, new RemindControlInfo(yourShowTick, yourControl.BackColor)); } yourControl.BackColor = yourColor; } }
public void MarkControl(ListViewItem yourItem, Color yourColor, int yourShowTick) { try { if (yourItem != null) { System.Threading.Monitor.Enter(remindItemDc); if (remindItemDc.ContainsKey(yourItem)) { remindItemDc[yourItem] = new RemindControlInfo(yourShowTick, remindItemDc[yourItem].OriginColor); } else { remindItemDc.Add(yourItem, new RemindControlInfo(yourShowTick, yourItem.BackColor)); } System.Threading.Monitor.Exit(remindItemDc); yourItem.BackColor = yourColor; } } catch (Exception ex) { } }