private void FormConsulta_Load(object sender, EventArgs e) { // this.dtConsulta.CellFormatting += this.dtConsulta_CellFormatting; this.dtConsulta.ColumnHeadersDefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter; this.dtConsulta.ColumnHeadersDefaultCellStyle.BackColor = System.Drawing.SystemColors.Control; this.dtConsulta.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.55F, System.Drawing.FontStyle.Bold); this.dtConsulta.ColumnHeadersDefaultCellStyle.ForeColor = System.Drawing.Color.DarkSlateGray; Consulta = this; //panelEx2.Visible = false; // pnlPrincipal.Enabled = false; panelEx3.Enabled = false; // dtConsulta.Enabled=false; dtConsulta.Rows.Add(1); dtAlmacen.Rows.Add(1); dtNombre.Rows.Add(1); txtNombre.AutoCompleteCustomSource = FormConsulta.LoadAutoCompleteNombre(); txtNombre.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtNombre.AutoCompleteSource = AutoCompleteSource.CustomSource; panelPreview.Visible = false; }
private void vbtnConsulta_Click(object sender, EventArgs e) { if (!frm_dconsulta.Visible) { try { this.frm_dconsulta.MdiParent = this; System.Threading.Thread.Sleep(250); this.frm_dconsulta.Show(); } catch (System.ObjectDisposedException) { frm_dconsulta = new Venta.FormConsulta(); this.frm_dconsulta.MdiParent = this; System.Threading.Thread.Sleep(250); this.frm_dconsulta.Show(); } } else { frm_dconsulta.Focus(); } }