//------------------------------------------------------------------------------------------------------------------- private void btLocalizar_Click(object sender, EventArgs e) { try { frmConsultaCor frm = new frmConsultaCor(); frm.ShowDialog(); if (frm.codigo >= 0) { BLLSubCategoria bll = new BLLSubCategoria(); ModeloSubCategoria modelo = bll.carregaModelo(frm.codigo); txtSubCodigo.Text = modelo.scat_cod.ToString(); txtSubCategoria.Text = modelo.scat_nome; cbCategoria.SelectedValue = modelo.cat_cod; this.alteraBotoes(3); } frm.Dispose(); }catch (Exception error) { MessageBox.Show(error.Message); } }