protected override void OnActivated(EventArgs e) { Debug.WriteLine("OnActivated"); base.OnActivated(e); dropdownClosed = false; // Assign the old string value to compare with the new value for any changes. oldStrValue = ccbParent.Text; // Make a copy of the checked state of each item, in cace caller cancels selection. checkedStateArr = new bool[cclb.Items.Count]; for (int i = 0; i < cclb.Items.Count; i++) { checkedStateArr[i] = cclb.GetItemChecked(i); } }
public bool GetItemChecked(int index) { if (index < 0 || index > Items.Count) { throw new ArgumentOutOfRangeException(nameof(index), @"value out of range"); } else { return(listBox.GetItemChecked(index)); } }
protected override void OnActivated(EventArgs e) { Debug.WriteLine("OnActivated"); base.OnActivated(e); dropdownClosed = false; oldStrValue = ccbParent.Text; checkedStateArr = new bool[cclb.Items.Count]; for (int i = 0; i < cclb.Items.Count; i++) { checkedStateArr[i] = cclb.GetItemChecked(i); } }
public string GetCheckedItemsStringValue() { StringBuilder sb = new StringBuilder(""); if (cclb.GetItemChecked(0) || cclb.CheckedItems.Count == cclb.Items.Count - 1) { sb.Append("All"); } else { for (int i = 0; i < cclb.CheckedItems.Count; i++) { sb.Append(cclb.GetItemText(cclb.CheckedItems[i])).Append(ccbParent.ValueSeparator); } if (sb.Length > 0) { sb.Remove(sb.Length - ccbParent.ValueSeparator.Length, ccbParent.ValueSeparator.Length); } } return(sb.ToString()); }
private Color GetCodeItemBackColor(CustomCheckedListBox listbox, DrawItemEventArgs e) { if (e.Index == selectedLine) { return(DebuggerBreakpointHitColor); } if (listbox.GetItemChecked(e.Index)) { return(DebuggerBreakpointColor); } return(listbox.BackColor); }
protected override void OnVisibleChanged(EventArgs e) { base.OnVisibleChanged(e); if (this.Visible) { dropdownClosed = false; // Assign the old string value to compare with the new value for any changes. oldStrValue = ccbParent.Text; // Make a copy of the checked state of each item, in cace caller cancels selection. checkedStateArr = new bool[cclb.Items.Count]; for (int i = 0; i < cclb.Items.Count; i++) { checkedStateArr[i] = cclb.GetItemChecked(i); } } //else //{ // Accept(); //} }