线程中调用主窗体的form,用来show子窗体,高分求关注此问题
private void BarCodeToolStripMenuItem_Click(object sender, EventArgs e)
{
Thread td = new Thread(MessageShow);
td.Start();
}
public void MessageShow()
{
MessageForm msg = new MessageForm();
this.Invoke(new MethodInvoker(delegate
{
msg.MdiParent = this;
}));
msg.Show();
}
MessageForm msg = new MessageForm();
this.Invoke(new MethodInvoker(delegate
{
msg.Show();
}));