delegate void SetTextCallback(String^ text);private: void SetText(String^ text)
{ if (labPK->InvokeRequired)
{
SetTextCallback^ d = gcnew SetTextCallback(this,&Form1::SetText);
labPK->Invoke(d, gcnew array<Object^>{ text });

}
else
{
labPK->Text = text;
}
}
在一个自定义线程中改变lable的text,用了上面的方法,可程序不能正常执行,到了invoke就不继续了。
这样写有何不妥,望高手指点!!