110,502
社区成员
发帖
与我相关
我的任务
分享
th[0] = new System.Threading.Thread(new System.Threading.ThreadStart(show));
th[0].Start();
public void show()
{
~~~~~省~~~~
~~~~~~~~~~
~~~~~略~~~
f1.ShowDialog();
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication36
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
new System.Threading.Thread(new System.Threading.ThreadStart(invokeShow)).Start();
}
public void invokeShow()
{
Form f1 = new Form();
this.Invoke(new System.EventHandler(this.showForm), new object[] { f1, null });
}
public void showForm(object sender,EventArgs e)
{
Form f1 = sender as Form;
f1.ShowDialog();
}
}
}