and here is my code in c#:
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 Thread_test
{
public partial class Form1 : Form
{
Thread process = new Thread(new ThreadStart(task));
public void task()
{
int a = 0;
for (; ; )
{
a = a + 1;
textBox1.Text = Convert.ToString(a);
}
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
process.Start();
}
}
}
Thanks for your help !-)
G scerriPosted Jan 12, 2011, 7:34 AM
Mamta MPosted Jan 11, 2011, 10:30 PM
public partial class Form1 : Form
{
Thread process;
public void task()
{
int a = 0;
for (; ; )
{
a = a + 1;
textBox1.Text = Convert.ToString(a);
}
}
public Form1()
{
InitializeComponent();
process = new Thread(new ThreadStart(task));
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
process.Start();
}
}