private void button1_Click(object sender, EventArgs e) { //this.timer1.Enabled = true; Task t1 = new Task(set); t1.Start(); } public void set() { while (true) { Thread.Sleep(1000); this.textBox2.Text = DateTime.Now.ToString("ffffff"); } }