private void MoveTo(WrapperControl wrapper, Point point) { var control = panelContainer.GetChildAtPoint(point); var index = control == null ? panelContainer.Controls.Count - 1 : panelContainer.Controls.GetChildIndex(control); panelContainer.Controls.SetChildIndex(wrapper, index); }
private void MoveTo(WrapperControl wrapper, Point point) { var control = panelContainer.GetChildAtPoint(point); var index = control == null ? panelContainer.Controls.Count - 1 : panelContainer.Controls.GetChildIndex(control); panelContainer.Controls.SetChildIndex(wrapper, index); //reassign taborder for tab navigation to honor visual order var tabIndex = 0; foreach (Control c in panelContainer.Controls) { c.TabIndex = tabIndex++; } }
private void AddControl(string name, SerializableMap settings = null) { settings = settings ?? new SerializableMap(); var control = CreateControl(name, settings); var wrapper = new WrapperControl(control, RemoveControl) { ItemName = settings.GetString("$Name", "NO NAME") }; panelContainer.Controls.Add(wrapper); var ioc = control as IoControl; ioc.Enable(false); controls.Add(ioc); }
private void AddControl(string name, SerializableMap settings = null) { settings = settings ?? new SerializableMap(); var control = CreateControl(name, settings); var wrapper = new WrapperControl(control, () => ior.Run(() => controls.Remove((IoControl)control))) { ItemName = settings.GetString("$Name", "NO NAME") }; panelContainer.Controls.Add(wrapper); ior.Run(() => { var ioc = (IoControl)control; ioc.SetMaster(master); controls.Add(ioc); }); }
private void RemoveControl(WrapperControl wrapper) { controls.Remove((IoControl)wrapper.Control); panelContainer.Controls.Remove(wrapper); }