using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Test
{
public partial class Form1 : Form
{
NewThread ntT;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ntT = new NewThread();
ntT.ShowWindow();
}
}
public class NewThread
{
Form frmT = new Form();
System.Threading.Thread thrdT;
~NewThread()
{
if (thrdT.ThreadState == System.Threading.ThreadState.Running) thrdT.Abort();
}
public void ShowWindow()
{
thrdT = new System.Threading.Thread(new System.Threading.ThreadStart(newthread));
thrdT.Start();
}
public void ShowWindow(Form frmToShow)
{
frmT = frmToShow;
thrdT = new System.Threading.Thread(new System.Threading.ThreadStart(newthread));
thrdT.Start();
}
private void newthread()
{
Form frmT = new Form();
frmT.Show();
while (!frmT.IsDisposed)
{
Application.DoEvents();
}
}
}
}
以上仅供参考。
多说一句,我也不喜欢看到动不动就跪求啊什么的。搞得没半点自尊。。。