GUIの遅延(フォームが応答しなくなる)の問題が原因で、新しいスレッドでフォームを開始しました。このスレッドは、関数(some_function())が呼び出されたときに開始されます。そのような...
/*========some_function=========*/
void some_function()
{
System::Threading::Thread^ t1;
System::Threading::ThreadStart^ ts = gcnew System::Threading::ThreadStart(&ThreadProc);
t1 = gcnew System::Threading::Thread(ts);
t1->Start();
while(condition)
{
Form1^ f1=gcnew Form1();
//some coding
//to change the values of a different form (Form1)
}
}
/*======ThreadProc=========*/
void ThreadProc()
{
Form1^ f1=gcnew Form1();
f1->Show(); //OR Application::Run(Form1());
}
ここで問題となるのは、「while」ループ内で、ラベルテキスト、プログレスバーなどのフォーム(Form1)の値を変更することです。別のスレッドで開いているフォームの値を変更する方法はありますか?