ورود

View Full Version : توقف نکردن پروگرس بار



User_Soual
چهارشنبه 03 بهمن 1397, 23:54 عصر
سلام من یک کدی دارم که باید پروگرس بار یواش یواش اضافن بشه ولی یکدفعه پر میشه

Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

بعدش باید فرم باز شه

Form f =new form();
F.showdialog();

ولی یک دفعه پروگرس بار پر میشه بعد فرم باز میشه

barnamenevisjavan
شنبه 13 بهمن 1397, 08:11 صبح
سلام من یک کدی دارم که باید پروگرس بار یواش یواش اضافن بشه ولی یکدفعه پر میشه

Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

System.threading.thread.sleep(1000);
Bar.value+=4;

بعدش باید فرم باز شه

Form f =new form();
F.showdialog();

ولی یک دفعه پروگرس بار پر میشه بعد فرم باز میشه
از حلقه استفاده کنید
for(int i = 0; i < 100; i++)
{
pbStatus.Value++;
Thread.Sleep(100);
}