110,539
社区成员
发帖
与我相关
我的任务
分享
public Form1()
{
InitializeComponent();
SetTxt = new SetTxt_(SetTxt__);
}
public delegate void SetTxt_(string str);
public static SetTxt_ SetTxt;
void SetTxt__(string str)
{
if (textBox1.InvokeRequired)
this.Invoke(SetTxt, str);
else
textBox1.Text = str;
}
委托调用Form1.SetTxt("");就可以调用。