110,528
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string s;
public Form1(string s1)
{
s = s1;
}
public void showtime()
{
s = DateTime.Now.ToLongTimeString();
}
private void button1_Click(object sender, EventArgs e)
{
Form1 f = new Form1(label1.Text);
Thread th = new Thread(new ThreadStart(f.showtime));
th.Start();
th.Join();
}
}
}