private void homeToolStripMenuItem_Click(object sender, EventArgs e) { this.panel1.Controls.Clear(); UcHome ucHome = new UcHome(); this.panel1.Controls.Add(ucHome); }
private void HomeButton_Click(object sender, EventArgs e) { if (!MainPanel.Controls.ContainsKey("ucHome")) { UcHome ucHome = new UcHome(); ucHome.Size = MainPanel.Size; ucHome.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom); MainPanel.Controls.Add(ucHome); } MainPanel.Controls["ucHome"].BringToFront(); toolStripStatusLabel1.Text = "Sistema de facturación – Pantalla de Inicio."; }
private void frmPrincipal_Load(object sender, EventArgs e) { UcHome ucHome = new UcHome(); this.panel1.Controls.Add(ucHome); }
private async void ShowControl(Option option) { Control currentControl = null; switch (option) { case Option.Home: if (UcHome == null) { UcHome = new UcHome(); } UcHome.RefreshControl(); currentControl = UcHome; break; case Option.Brands: if (UcBrands == null) { UcBrands = new UcBrands(); } currentControl = UcBrands; break; case Option.Drivers: if (UcDrivers == null) { UcDrivers = new UcDrivers(); } await UcDrivers.SearchDrivers(); currentControl = UcDrivers; break; case Option.Infractions: if (UcInfractions == null) { UcInfractions = new UcInfractions(); } await UcInfractions.SearchInfractions(); currentControl = UcInfractions; break; case Option.InfractionTypes: if (UcInfractionTypes == null) { UcInfractionTypes = new UcInfractionTypes(); } currentControl = UcInfractionTypes; break; case Option.Vehicles: if (UcVehicles == null) { UcVehicles = new UcVehicles(); } await UcVehicles.SearchVehicles(); currentControl = UcVehicles; break; } if (currentControl != null) { currentControl.Dock = DockStyle.Fill; this.panelContainer.Controls.Clear(); this.panelContainer.Controls.Add(currentControl); } }