// To Display in Text box. private void DisplayText() { BoomStubAngle: int BoomStubAngle = 0; for (int i = j; i <= ds.Tables[0].Rows.Count; i++) { string BSAname = ds.Tables[0].Rows[i][BSA].ToString(); txt_BSA.Text = BSAname.ToString(); txt_BSA.Focus(); } BoomForeAngle: int BoomForeAngle = 1; for (int i = j; i <= ds.Tables[0].Rows.Count; i++) { string BFAname = ds.Tables[0].Rows[i][BFA].ToString(); txt_BFA.Text = BFAname.ToString(); txt_BFA.Focus(); } BoomForeHeadEndPressure: int BoomForeHeadEndPressure = 2; for (int i = j; i <= ds.Tables[0].Rows.Count; i++) { string BFname = ds.Tables[0].Rows[i][BFHEP].ToString(); txt_BFHEP1.Text = BFname.ToString(); txt_BFHEP1.Focus(); j++; // Thread sleep Time-From User Input Thread.Sleep(Convert.ToInt32(Stimer)); goto BoomStubAngle; } connclose: connExcel.Close(); } //??Iam not getting focus to this button in run time when thread is running.?? private void button2_Click(object sender, EventArgs e) { startstop = false; //do //{ // Thread.Sleep(1000); //} //while (startstop == true); //DisplayText(); }
Thread.Sleep
goto
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)