public cadFuncionario(TipoTab tipoTab) { InitializeComponent(); if (tipoTab == TipoTab.Consulta) // controle da abertura da tela na aba cadastro ou consulta { tabControl1.SelectedTab = tabPage2; } else { tabControl1.SelectedTab = tabPage1; // aba cadastro } }
public cadCliente(TipoTab tipoTab) { InitializeComponent(); if (tipoTab == TipoTab.Consulta) // controle da abertura da tela na aba cadastro ou consulta { tabControlCliente.SelectedTab = tabPageConsulta; } else { tabControlCliente.SelectedTab = tabPageCadastro; } }
private void CargarTabItem(TipoTab tipo) { //Primero buscamos en la lista de tab que no exista if (!tableTabs.ContainsKey(tipo)) { CloseableTabItem newTab = new CloseableTabItem(); this.AddHandler(CloseableTabItem.CloseTabEvent, new RoutedEventHandler(this.CloseTab)); switch (tipo) { case TipoTab.VisualizarInventarioDisp: newTab.Name = "tabInventarioD"; newTab.Header = "Inventario KARDEX"; newTab.Content = new ViewInventarioD(); break; case TipoTab.EfectuarTransaccion: newTab.Name = "tabEfecTransacciones"; newTab.Header = "Transacciones"; newTab.Content = new viewTransacciones(); break; case TipoTab.ComprasInventarios: newTab.Name = "tabComprasInv"; newTab.Header = "Compras"; newTab.Content = new viewComprasInv(); break; case TipoTab.BalanceGeneral: newTab.Name = "tabBalGral"; newTab.Header = "Balance General"; newTab.Content = new viewBalanceGeneral(); break; case TipoTab.CatalogoCuentas: newTab.Name = "tabCCuentas"; newTab.Header = "Catalogo Cuentas"; newTab.Content = new viewCatalogoCuentas(); break; case TipoTab.BalanceComprobacion: newTab.Name = "tabBalC"; newTab.Header = "Balance de Comprobacion"; newTab.Content = new viewBalanceComprobacion(); break; case TipoTab.OrdenFabricacion: newTab.Name = "tabOrdenFab"; newTab.Header = "Orden Fabricación"; newTab.Content = new viewOrdenFabricacion(); break; case TipoTab.EstadoCapital: newTab.Name = "tabEstCap"; newTab.Header = "Estado de Capital"; newTab.Content = new viewEstadoCapital(); break; case TipoTab.EstadoResultados: newTab.Name = "tabEstRes"; newTab.Header = "Estado de Resultados"; newTab.Content = new viewEstadoResultados(); break; case TipoTab.EmpleadoAgregar: newTab.Name = "tabNewEmp"; newTab.Header = "Agregar Empleado"; newTab.Content = new viewEmpleadoNuevo(); break; case TipoTab.EmpleadoGestionar: newTab.Name = "tabEmpGes"; newTab.Header = "Gestionar Empleados"; newTab.Content = new viewEmpleados(); break; case TipoTab.Propiedades: newTab.Name = "tabPropiedades"; newTab.Header = "Propiedades"; newTab.Content = new viewSettings(); break; } //Agregamos a la tabla Hash el nuevo control newTab.Tag = tipo; tableTabs.Add(tipo, newTab); tab_Ventanas.Items.Add(newTab); tab_Ventanas.SelectedIndex = tab_Ventanas.Items.Count - 1; newTab.Focus(); } }