private void cbox_Opcoes_SelectedIndexChanged(object sender, EventArgs e) { switch (cbox_Opcoes.Text) { case "Novo": formEnderecoNovo frmShowNovo = new formEnderecoNovo(); frmShowNovo.Show(); break; case "Editar": formEnderecoEditar frmShowEditar = new formEnderecoEditar(ID); frmShowEditar.Show(); break; case "Visualizar Log": formEnderecoLog frmShowVis = new formEnderecoLog(); frmShowVis.Show(); break; default: MessageBox.Show("Opção invalida", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); break; } }
private void editarToolStripMenuItem_Click(object sender, EventArgs e) { formEnderecoEditar formShow = new formEnderecoEditar(Convert.ToInt32(dataGridView_Lista.SelectedRows[0].Cells["ID"].Value)); formShow.Show(); }