Beispiel #1
0
        private void txCEP_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                try
                {
                    txNumero.Enabled = true;
                    this.ActiveControl = txNumero;
                    PreencheCamposCEP();
                }
                catch (Exception err)
                {
                    MessageBox.Show("CEP não localizado!" + err.Message);
                    frmPesquisaCEP pesquisa = new frmPesquisaCEP();
                    pesquisa.ShowDialog();
                    txCEP.Text = pesquisa.CEP;
                    pesquisa.Close();
                    PreencheCamposCEP();
                }

            }
        }
Beispiel #2
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     frmPesquisaCEP pesquisa = new frmPesquisaCEP();
     pesquisa.ShowDialog();
     txCEP.Text = pesquisa.CEP;
     PreencheCamposCEP();
     pesquisa.Close();
 }