private void ComboMotor_SelectedIndexChanged(object sender, EventArgs e) { if (ComboMotor.SelectedIndex == -1) { return; } IControladorConexion obj = Motores[ComboMotor.SelectedIndex]; Contenedor.Controls.Clear(); Height = obj.Height + panel2.Height + panel1.Height; obj.Parent = Contenedor; obj.Visible = true; ControladorActual = obj; }
private void SeleccionaControlador(string con) { CargaMotores(); int i, n; n = ComboMotor.Items.Count; for (i = 0; i < n; i++) { string s = ComboMotor.Items[i].ToString(); if (s == con) { ComboMotor.SelectedIndex = i; ControladorActual = Motores[i]; return; } } }
private void AddMotor(IControladorConexion obj) { ComboMotor.Items.Add(obj.ToString()); Motores.Add(obj); }