this is my main thread:
private void button1_Click(object sender, EventArgs e)
{
Thread oThread = new Thread(new ThreadStart(understand)); // create the thread for understand function
oThread.Start(); // start the thread
button1.Enabled = false;
Thread.Sleep(1);
if (false == understand_status)
{
MessageBox.Show("i am in main thread");
}
}
this is my sub-thread:
private void understand()
{
int license_value=0;
while (understand_status)
{
..............
if (license_value < 29)
{
understand_status = false;
...........
}
if (false == understand_status)
{
MessageBox.Show("inside while");
File.Delete("C:\\log.txt");
}
}
MessageBox.Show("outside while");
}
it is showing message "outside while" but not returning to main thread. where i am showing "i am in main thread". I am new to thread programming any help appreciated