private void txtBabat_Code_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 13)
     {
         if (txtBabat_Name.Text != "")
         {
             SendKeys.Send("{tab}");
         }
         else
         {
             frmPay_Recive_Identity f = new frmPay_Recive_Identity();
             if (rbtnBed.Checked)
             {
                 f.Fill_Daryaft();
                 f.op = "Daryaft";
             }
             else
             {
                 f.Fill_Pardakht();
                 f.op = "Pardakht";
             }
             f.txtSearch.Text = txtBabat_Code.Text;
             f.ShowDialog();
             txtBabat_Code.Text = f.Iden_Code;
             txtMoeen_Code.Text = f.Moeen_Code;
         }
     }
 }
        private void btnSearch_Babat_Click(object sender, EventArgs e)
        {
            try
            {
                frmPay_Recive_Identity f = new frmPay_Recive_Identity();
                if (rbtnBed.Checked)
                {
                    f.Fill_Daryaft();
                    f.op = "Daryaft";
                }
                else
                {
                    f.Fill_Pardakht();
                    f.op = "Pardakht";
                }

                f.ShowDialog();
                txtBabat_Code.Text = f.Iden_Code;
                txtMoeen_Code.Text = f.Moeen_Code;
            }
            catch
            {
                txtBabat_Code.Text = txtMoeen_Code.Text = "";
            }
        }
 private void txtBabat_Code_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 13)
     {
         if (txtBabat_Name.Text != "")
         {
             txtNotice.Focus();
         }
         else
         {
             frmPay_Recive_Identity f = new frmPay_Recive_Identity();
             f.Fill_Daryaft();
             f.op             = "Daryaft";
             f.txtSearch.Text = txtBabat_Code.Text;
             f.ShowDialog();
             txtBabat_Code.Text = f.Iden_Code;
             txtMoeen_Code.Text = f.Moeen_Code;
         }
     }
 }