1

Even finding the desired value in the register vector displays the message "TP não encontrado". I need that when the value is found it does not display the message that was not found.

for (int i = 0; i < cadastro_tp.Length; i++)
{
   if (txbTp.Text == cadastro_tp[i].tpv)
   {
      txbCnpj.Text = cadastro_tp[i].cnpjv;
      txbNome.Text = cadastro_tp[i].nomev;
      cboCanal.Text = cadastro_tp[i].canalv;
      txbPortal.Text = cadastro_tp[i].portalv;
      txbEmpresa.Text = cadastro_tp[i].empv;
      txbEmail.Text = cadastro_tp[i].emailv;
      txbTel.Text = cadastro_tp[i].telv;
      break;
   }
}
MessageBox.Show("TP não encontrado");
Brian
  • 584
  • 3
  • 13
Ronison Matos
  • 229
  • 4
  • 9

1 Answers1

0

I was able to solve by replacing the break to return.

Bence Kaulics
  • 1,007
  • 11
  • 21
Ronison Matos
  • 229
  • 4
  • 9