如何在Visual Studio C ++中使用Winforms progressBar

时间:2016-03-20 08:49:01

标签: c++ winforms

大家好,我现在正试图在Visual Studio C ++中掌握winforms GUI编程。

我在c#中遇到了一个问题但是如何在内部程序迭代循环时更新进度条的进度。我对数学建模特别感兴趣,但不知道如何实现一个体面的进度条。任何有关该主题的帮助都会很棒。这是我到目前为止所得到的:

private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) 
         {
             this->timer1->Start(); //Inside a start button

         }
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) 
{

         //this->progressBar1->PerformStep();
         this->progressBar1->Minimum=0;
         this->progressBar1->Maximum=100;

         for(int i = 0; i <= 100; i++) 
         {
           this->progressBar1->Value = i;
           this->progressBar1->PerformStep();
         }      


}

0 个答案:

没有答案