示例#1
0
 public void SelectSpecific(Control selected)
 {
     if (controls.Any(c => c.Selected))
     {
         controls.Where(c => c.Selected).ToList().ForEach((c) => { c.Deselect(); });
     }
     selected.Select();
 }
示例#2
0
        public void SelectNext(Control selected, bool up)
        {
            controls = controls.OrderBy(c => c.TabIndex).ToList();

            int direction = up ? 1 : -1;
            int index = selected == null ? 0 : controls.IndexOf(selected);

            do
            {
                index = (index + direction + controls.Count) % controls.Count;
            }
            while (controls[index].Selectable);

            var newselect = controls[index];

            newselect.Select();
            selected.Deselect();
        }
示例#3
0
 public void AddControl(Control control)
 {
     control.CMRef = this;
     controls.Add(control);
 }