0
我想在我的應用程序的另一個線程中顯示選取框進度條。 這裏是我的代碼:使用backgroundWorker創建並顯示progressBar - VS2013
bkgWorker->RunWorkerAsync();
private: System::Windows::Forms::ProgressBar^ progressBar;
private: System::Void bkgWorker_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) {
progressBar = (gcnew System::Windows::Forms::ProgressBar());
progressBar->Location = System::Drawing::Point(548, 349);
progressBar->MarqueeAnimationSpeed = 15;
progressBar->Name = L"progressBar";
progressBar->Size = System::Drawing::Size(100, 23);
progressBar->Style = System::Windows::Forms::ProgressBarStyle::Marquee;
progressBar->TabIndex = 23;
progressBar->Show();
}
private: System::Void bkgWorker_RunWorkerCompleted(System::Object^ sender, System::ComponentModel::RunWorkerCompletedEventArgs^ e) {
progressBar->Hide();
}
沒有錯,但我沒有看到我的窗體上的進度條。 我在做什麼錯? 感謝您的幫助。