public void MoveSelectedItemsinCheckedListBoxtoOtherListBox(CheckedListBox FromListBox, ListBox ToListBox) { try { int intSelectedItems = FromListBox.SelectedItems.Count; if (intSelectedItems > 0) { for (int i = 0; i < intSelectedItems; i++) { ToListBox.Items.Add(FromListBox.SelectedItems[0]); FromListBox.Items.Remove(FromListBox.SelectedItems[0]); } FromListBox.ClearSelected(); } else { return; } } catch (Exception ex) { MessageBox.Show("Exception:" + ex.Message); return; } }
void ButtonClearClick(object sender, System.EventArgs e) { listBox1.ClearSelected(); listBox2.ClearSelected(); listBox3.ClearSelected(); listBox4.ClearSelected(); }
private void UncheckAll(CheckedListBox clb) { foreach (int i in clb.CheckedIndices) { clb.SetItemCheckState(i, CheckState.Unchecked); } clb.ClearSelected(); }
private void ClearCheckBoxList(CheckedListBox myList) { foreach (int i in myList.CheckedIndices) { myList.SetItemCheckState(i, CheckState.Unchecked); } myList.ClearSelected(); }
/*******************************************************************************************************/ #region CHECKED LISTBOX CONTROL public static void populateCheckedListBox(CheckedListBox clb, object data, string displayMember, string valueMember) { clb.DataSource = data; clb.DisplayMember = displayMember; clb.ValueMember = valueMember; clb.CheckOnClick = true; clb.ClearSelected(); }
public void ClearCheckedItems() { _checkedListBox.ClearSelected(); for (int i = 0; i < _checkedListBox.Items.Count; i++) { _checkedListBox.SetItemChecked(i, false); } Invalidate(); }
public List <T> CheckListToList <T>(CheckedListBox checkedList, List <T> anterior) { List <T> lista = new List <T>(); foreach (T elemento in checkedList.CheckedItems) { lista.Add(elemento); } if (!(lista.All <T>(e => anterior.Contains(e)) && anterior.All <T>(e => lista.Contains(e)))) { checkedList.ClearSelected(); } return(lista); }
/// <summary> /// 取消checkbox中 选中项状态 /// </summary> public void SetCheckState(bool state) { if (_KeyWordCheckedListBox.CheckedIndices.Count <= 0) { return; } foreach (int i in _KeyWordCheckedListBox.CheckedIndices) { _KeyWordCheckedListBox.SetItemChecked(i, state); } if (!state) { _KeyWordCheckedListBox.ClearSelected(); } }
private void SelectPair(CheckedListBox lb, CheckedListBox lb2, bool select = true, bool justSelected = false) { if (!lb.Focused) { return; } lb2.ClearSelected(); if (lb.SelectedIndices.Count > 0 && (lb.GetItemChecked(lb.SelectedIndex) || justSelected)) { int i = lb.CheckedIndices.OfType <int>().Count(x => x < lb.SelectedIndex); if (i < lb2.CheckedItems.Count) { lb2.SetSelected(lb2.CheckedIndices[i], select); } } }
public void Reload() { if (table != null) { table.Clear(); } if (useAccess) { LoadA(); } else { LoadS(); } SetMember(); CLB.ClearSelected(); }
private void bindControls() { refreshCounter1.CountdownTimer.Value = new DateTime(2000, 1, 1).Add(Settings.Default.PlaylistRefreshInterval); selectedChannelColorPicker.Color = Settings.Default.SelectedChannelBackground; alternatingChannelColorPicker.Color = Settings.Default.AlternatingChannelBackground; channelColorPicker.Color = Settings.Default.ChannelBackground; // set selected values sortOrderValue.Text = Settings.Default.ChannelSortOrder; sortByValue.Text = Settings.Default.ChannelSortBy; transparencyTrackBar.Value = ((int)(Settings.Default.FormOpacityValue * 100)); calendarFormatValue.Text = Settings.Default.CalendarFormat; serviceLevelValues.ClearSelected(); serviceLevelValues.SetItemChecked(serviceLevelValues.FindStringExact(Settings.Default.SubscriptionType), true); UsernameTextbox.Text = Settings.Default.Username; PasswordTextbox.Text = Settings.Default.Password; ListenKeyTextbox.Text = Settings.Default.ListenKey; // set the Listen Key link here //LinkLabel.Link link = new LinkLabel.Link(); //link.LinkData = P.Resources.ListenKeyLinkData; ListenKeyLinkLabel.Links[0].LinkData = P.Resources.ListenKeyLinkData; // radio buttons if (!Settings.Default.RememberPreviousChannel) { rememberNoRadio.PerformClick(); } if (!Settings.Default.ShowUserToast) { toastNoRadio.PerformClick(); } togglePremiumTextboxes(serviceLevelValues.SelectedIndex); }
//void txb_LostFocus(object sender, EventArgs e) //{ // TextBox tb = ((TextBox)sender); // tb.SelectionStart = 0; // tb.ScrollToCaret(); // if (tb.Text == "") tb.Text = TextBoxDefaultAll; //} void clbDetail_KeyDown(object sender, KeyEventArgs e) { CheckedListBox clb = (CheckedListBox)sender; if (e.KeyData == Keys.Escape) { dg.Focus(); } else if (e.KeyData == (Keys.Control | Keys.A)) { if (clb.Items.Count == 0) { return; } bool check = (clb.CheckedItems.Count > 0); for (int i = 0; i < clb.Items.Count; i++) { clb.SetItemChecked(i, (!check)); } clb.ClearSelected(); } else if (e.KeyData == Keys.F2) { RenamePiece(""); } else if (e.KeyData == (Keys.Control | Keys.E)) { tabControl.SelectedTab = tabControl.TabPages[1]; tabControl.Focus(); } else { return; } e.Handled = true; }
public void Clear() { _checkedListBox.ClearSelected(); }
private void answersCheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e) { answersCheckedListBox.ClearSelected(); bool isListEmpty = answersCheckedListBox.CheckedItems.Count == 1 && e.NewValue == CheckState.Unchecked; }
private void checkedListBox_SelectedIndexChanged(object sender, EventArgs e) { CheckedListBox listBox = (CheckedListBox)sender; listBox.ClearSelected(); }