private void checkedListBox_ItemCheck(object sender, ItemCheckEventArgs args) { string eventText = "Check state changed: box "; if (sender.Equals(this.checkedListBoxOne)) eventText += "one, value: " + this.checkedListBoxOne.Items[args.Index] + ", "; else if (sender.Equals(this.checkedListBoxTwo)) eventText += "two, value: " + this.checkedListBoxTwo.Items[args.Index] + ", "; eventText += "from: " + args.CurrentValue + ", " + "to: " + args.NewValue + "\n"; this.UpdateLog(eventText); }
/// <summary> /// Method linked to the ItemCheck event of the current object. /// </summary> private void this_ItemCheck(object sender, ItemCheckEventArgs e) { Window w = (this.clbControl.Items[e.Index].Item as Window); if (e.CurrentValue == CheckState.Checked) w.HideWindow(); else { if (this.isActive == true) { w.ShowWindow(); UnmanagedCode.SetForegroundWindow(DesktopUtil.Manager.ApplicationWindowHandle); } } }