private void FormCadFinalizadoras_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F6) { if (btnConsGeral.Enabled) { LimparCampos(); OrganizaBotoes(); butAlterar.Enabled = false; FormGridFinalizadora grid = new FormGridFinalizadora(this); grid.MdiParent = this.ParentForm; grid.Show(); } } else if (e.KeyCode == Keys.Enter) { if (e.Shift) { e.SuppressKeyPress = true; SendKeys.Send("+{TAB}"); } else { e.SuppressKeyPress = true; SendKeys.Send("{TAB}"); } } }
private void butConsultar_Click(object sender, EventArgs e) { if (tbCodigo.Text.Length == 0) { LimparCampos(); OrganizaBotoes(); butAlterar.Enabled = false; FormGridFinalizadora grid = new FormGridFinalizadora(this); grid.MdiParent = this.ParentForm; grid.Show(); } else { fin = new Finalizadora(); fin.Id = Convert.ToInt32(tbCodigo.Text); fin.ConsultaFinalizadora(); if (fin.Descricao != null) { tbDescricao.Text = fin.Descricao; butAlterar.Enabled = true; butExcluir.Enabled = true; } else { this.LimparCampos(); this.OrganizaBotoes(); } tbCodigo.SelectAll(); } }
private void btnConsGeral_Click(object sender, EventArgs e) { LimparCampos(); OrganizaBotoes(); butAlterar.Enabled = false; FormGridFinalizadora grid = new FormGridFinalizadora(this); grid.MdiParent = this.ParentForm; grid.Show(); }