Skip to main content
edited tags
Link
Bobby
  • 11.6k
  • 5
  • 48
  • 70
edited tags
Link
Tim Barrass
  • 5k
  • 2
  • 33
  • 57
deleted 57 characters in body
Source Link
Afnan Bashir
  • 7.4k
  • 20
  • 81
  • 145

IBasic Goal is that i have following code in Buttonfour progress bar and want thatto run them at once as many times button was clicked new thread is launched like if button is pressed 10 times then there should be 10 threadsand i donot have to use background worker have to do by this.

 var t = new Thread(() => { try {   var}  browser = new WatiN.Core }); t.IESetApartmentState("http://wwwApartmentState.googleSTA); t.com"Start(); 

I tried and codded

 for (i = 0; i < 4; i++)  if (checkBox1.Checked == true { var t = new Thread(() => { browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.ShowMaximized); for (double x = 0; x < 10000; x = x + 0.5)  }  else{ browser.ShowWindow progressVal=(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Hideint);x; browser this.TextFieldInvoke(WatiN.Core.Find.ByNamenew EventHandler("q"ProgressBar)).TypeText(textBox1.Text); //System.Threading. Thread.Sleep(50002); browser.Button(WatiN.Core.Find.ByName("btnG")).Click();     browser.Link(WatiN.Core.Find.ByText("3")).Click();  } catch (Exception ca }); { t.SetApartmentState(ApartmentState.STA); MessageBoxt.ShowStart(ca.Message); } private void ProgressBar(object sender, EventArgs e) });{ t.SetApartmentState(ApartmentState progressBar1.STA);Value=progressVal; t.Start();} 

but cannot think of idea how to manuplate other progress bars

I have following code in Button and want that as many times button was clicked new thread is launched like if button is pressed 10 times then there should be 10 threads

 var t = new Thread(() => { try { var browser = new WatiN.Core.IE("http://www.google.com"); if (checkBox1.Checked == true) { browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.ShowMaximized);  }  else browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Hide); browser.TextField(WatiN.Core.Find.ByName("q")).TypeText(textBox1.Text); //System.Threading.Thread.Sleep(5000); browser.Button(WatiN.Core.Find.ByName("btnG")).Click();  browser.Link(WatiN.Core.Find.ByText("3")).Click();  } catch (Exception ca) { MessageBox.Show(ca.Message); } }); t.SetApartmentState(ApartmentState.STA); t.Start(); 

Basic Goal is that i have four progress bar and want to run them at once as button is pressed and i donot have to use background worker have to do by this.

 var t = new Thread(() => { try {   }   }); t.SetApartmentState(ApartmentState.STA); t.Start(); 

I tried and codded

 for (i = 0; i < 4; i++)   { var t = new Thread(() => { for (double x = 0; x < 10000; x = x + 0.5)  {  progressVal=(int)x;  this.Invoke(new EventHandler(ProgressBar));  Thread.Sleep(2);    }  });  t.SetApartmentState(ApartmentState.STA); t.Start(); } private void ProgressBar(object sender, EventArgs e) {  progressBar1.Value=progressVal; } 

but cannot think of idea how to manuplate other progress bars

Source Link
Afnan Bashir
  • 7.4k
  • 20
  • 81
  • 145
Loading