public void SelectSpecific(Control selected) { if (controls.Any(c => c.Selected)) { controls.Where(c => c.Selected).ToList().ForEach((c) => { c.Deselect(); }); } selected.Select(); }
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(); }
public void AddControl(Control control) { control.CMRef = this; controls.Add(control); }