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(); } } }
线程打开窗体的问题
最新推荐文章于 2022-09-12 17:28:06 发布