问题描述
我正在尝试写一个文本框,同时在backgroundworker上有一个循环。我尝试使用Invoke / BeginInvoke,但是我做不到。我如何更改它才能使其正常工作?这是我的下面的代码,谢谢。
delegate void backgroundWorker1_DoWorkDelegate(Object^ sender,DoWorkEventArgs^ e);
private: System::Void backgroundWorker1_DoWork(System::Object^ sender,System::ComponentModel::DoWorkEventArgs^ e) {
if (textBox1->InvokeRequired)
{
backgroundWorker1_DoWorkDelegate^ action = gcnew backgroundWorker1_DoWorkDelegate(this,&MyForm::Worker);
this->BeginInvoke(action);
}
else
{
textBox1->Text = "a";
} ... }
void Worker(System::Object^ sender,System::ComponentModel::DoWorkEventArgs^ e)
{
textBox1->Text = "a";
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)