Exemplo n.º 1
0
 private void CLBKeys_SelectedValueChanged(object sender, EventArgs e)
 {
     if (ic)
     {
         CLBKeysCopy = CLBKeys;
         CLBKeys.Refresh();
         ic = !ic;
     }
 }
Exemplo n.º 2
0
        private void mbSelectFilter_Click(object sender, EventArgs e)
        {
            if (ttbFilter.TextLength == 0)
            {
                for (int i = 0; i < CLBKeys.Items.Count; i++)
                {
                    CLBKeys.SetItemChecked(i, true);
                }
                return;
            }

            for (int i = 0; i < CLBKeys.Items.Count; i++)
            {
                MatchCollection matches = Regex.Matches(CLBKeys.GetItemText(CLBKeys.Items[i]), ttbFilter.Text, RegexOptions.IgnoreCase);
                //if (CLBKeys.GetItemText(CLBKeys.Items[i]).ToUpper().Contains(ttbFilter.Text.ToUpper()))
                if (matches.Count > 0)
                {
                    CLBKeys.SetItemChecked(i, true);
                }
            }

            tssl2.Text = $"Выбрано ключей: {CLBKeys.CheckedItems.Count.ToString()}";
            CLBKeys.Refresh();
        }