private void loopGreen(object o) { int c = (int)o; CTMethod ctGreen = new CTMethod(updateGreen); if (c < 500) { for (int i = 0; i < c; i++) { if (pictureBox2.Top > 0 && pictureBox2.Top != textBox2.Top + textBox2.Height) { this.Invoke(ctGreen, i); Thread.Sleep(20); } else { break; } } } else { MessageBox.Show("Enter a valure less than 500 for Green Box!!!"); } CTFinish CTFin = new CTFinish(Threadfinish); this.Invoke(CTFin, "Green"); }
private void loopBlue(object o) { int c = (int)o; CTMethod ctBlue = new CTMethod(updateBlue); if (c < 500) { for (int i = 0; i < c; i++) { if (pictureBox3.Left + pictureBox3.Width < this.Width) { this.Invoke(ctBlue, i); Thread.Sleep(20); } else { break; } } } else { MessageBox.Show("Enter a valure less than 500 for Blue Box!!!"); } CTFinish CTfin = new CTFinish(Threadfinish); this.Invoke(CTfin, "Blue"); }
private void loopRed(object o) { int c = (int)o; CTMethod ctRed = new CTMethod(updateRed); if (c < 500) { for (int i = 0; i < c; i++) { if (pictureBox1.Left > 0) { this.Invoke(ctRed, i); Thread.Sleep(20); } } } else { MessageBox.Show("Enter a value less than 500 for Red Box!!!"); } CTFinish CTFin = new CTFinish(Threadfinish); this.Invoke(CTFin, "Red"); }