private void ctrl_OnExitControlEvent(ucBase luncherControl) { if (panel_DERECHO.Contains(luncherControl)) { RemoveControlFromPannel((ucBase)luncherControl); } }
public void RemoveControlFromPannel(ucBase ctrl) { if (ctrl != null) { if (panel_DERECHO.Contains(ctrl)) { panel_DERECHO.Controls.Remove(ctrl); ctrl.Dispose(); } } }
public void AddContronToPannel(ButtonsMenu item) { ucBase ctrl = (ucBase)Fwk.HelperFunctions.ReflectionFunctions.CreateInstance(item.Component); ctrl.Parent = panel_DERECHO; ctrl.Key = item.ID; panel_DERECHO.Controls.Add(ctrl); ctrl.Dock = System.Windows.Forms.DockStyle.Fill; ctrl.OnExitControlEvent += new ExitControlHandler(ctrl_OnExitControlEvent); ctrl.BringToFront(); ctrl.Refresh(); }