コード例 #1
0
 /// <summary>
 /// Inicializa el formulario que permite el alta de un nuevo instrumento, subscribiendo
 /// al evento que lanza el alta.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAlta_Click(object sender, EventArgs e)
 {
     this.formInstrumento = new FrmInstrumento();
     //deshabilito los controles que no corresponden a la instancia del forminstrumentos
     this.formInstrumento.btnModificar.Enabled      = false;
     this.formInstrumento.btnSeleccionar.Enabled    = false;
     this.formInstrumento.btnEliminar.Enabled       = false;
     this.formInstrumento.ModificacionInstrumentos += ManejadorActualizaLista;
     this.formInstrumento.ShowDialog();
 }
コード例 #2
0
        /// <summary>
        /// Inicializa el formulario que permite la seleccion de un instrumento, subscribiendo
        /// al evento que lanza la eleccion.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnElegir_Click(object sender, EventArgs e)
        {
            this.formInstrumento = new FrmInstrumento(this.tienda);
            //deshabilito los controles que no corresponden a la instancia del forminstrumentos
            this.formInstrumento.cmbInstrumento.Enabled = false;
            this.formInstrumento.txtMarca.Enabled       = false;
            this.formInstrumento.txtModelo.Enabled      = false;
            this.formInstrumento.txtPrecio.Enabled      = false;
            this.formInstrumento.txtSerie.Enabled       = false;
            this.formInstrumento.cmbTipo.Enabled        = false;
            //deshabilito los botones que no corresponden a la instancia del forminstrumentos
            this.formInstrumento.btnAlta.Enabled      = false;
            this.formInstrumento.btnModificar.Enabled = false;
            this.formInstrumento.btnEliminar.Enabled  = false;

            this.formInstrumento.SeleccionInstrumento += ManejadorSeleccionInstrumento;
            this.formInstrumento.ShowDialog();
        }