J
Jozef
Hi!
In class1.cs i have something like this:
public class Class1
{
int b = 0;
public Class1()
{
}
public void DoSomething()
{
do {
b++;
Thread.Sleep(1000);
} while (true);
}
}
in Form1 i have a label control and i want to show values that from DoSomething() in class1.cs
private void Form1_Load(...)
{
Class1 obj = new Class1();
Thread wrk = new Thread(new ThreadStart(obj.DoSomething));
wrk.Start();
}
how to update gui, i.e. label control on form to show values from thread every second?
In class1.cs i have something like this:
public class Class1
{
int b = 0;
public Class1()
{
}
public void DoSomething()
{
do {
b++;
Thread.Sleep(1000);
} while (true);
}
}
in Form1 i have a label control and i want to show values that from DoSomething() in class1.cs
private void Form1_Load(...)
{
Class1 obj = new Class1();
Thread wrk = new Thread(new ThreadStart(obj.DoSomething));
wrk.Start();
}
how to update gui, i.e. label control on form to show values from thread every second?