展开全部
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace FormA
{
public partial class FormA : Form
{
public FormA()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Thread thread = new Thread(threadPro);
thread.Start();
}
private void threadPro()
{
MethodInvoker methodInvoker = new MethodInvoker(ShowFormB);
BeginInvoke(methodInvoker);
}
private void ShowFormB()
{
FormB frmB = new FormB();
frmB.Show();
}
}
}