private void dgvFale_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dgvFale.CurrentRow == null) { MessageBox.Show("NÃO HÁ CLIENTES CADASTRADOS!", "AVISO!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { addcliente f2 = new addcliente(); f2.txtIDcliente.Text = this.dgvFale.CurrentRow.Cells[0].Value.ToString(); f2.txtNome.Text = this.dgvFale.CurrentRow.Cells[1].Value.ToString(); f2.mskTelefone.Text = this.dgvFale.CurrentRow.Cells[2].Value.ToString(); f2.mskCelular.Text = this.dgvFale.CurrentRow.Cells[3].Value.ToString(); f2.txtEmail.Text = this.dgvFale.CurrentRow.Cells[4].Value.ToString(); f2.cboSexo.Text = this.dgvFale.CurrentRow.Cells[5].Value.ToString(); f2.mskNascimento.Text = this.dgvFale.CurrentRow.Cells[6].Value.ToString(); f2.mskCEP.Text = this.dgvFale.CurrentRow.Cells[7].Value.ToString(); f2.txtLogradouro.Text = this.dgvFale.CurrentRow.Cells[8].Value.ToString(); f2.txtCidade.Text = this.dgvFale.CurrentRow.Cells[9].Value.ToString(); f2.cboUF.Text = this.dgvFale.CurrentRow.Cells[10].Value.ToString(); f2.txtBairro.Text = this.dgvFale.CurrentRow.Cells[11].Value.ToString(); f2.txtNumero.Text = this.dgvFale.CurrentRow.Cells[12].Value.ToString(); f2.mskRG.Text = this.dgvFale.CurrentRow.Cells[13].Value.ToString(); f2.mskCPF.Text = this.dgvFale.CurrentRow.Cells[14].Value.ToString(); f2.txtComplemento.Text = this.dgvFale.CurrentRow.Cells[15].Value.ToString(); f2.ShowDialog(); } }
private void cadastroToolStripMenuItem1_Click(object sender, EventArgs e) { addcliente add = new addcliente(); add.ShowDialog(); }