Treads in Compact Framework

  • Thread starter Thread starter Ghost
  • Start date Start date
G

Ghost

Hello there.
I have some problem with treads in Compact Framework.
Lets I explain what exactly :

Lets take some example:
I have start Window Application and put on it one progress bar and one
button, now I'm doing so:

private void button1_Click(object sender, System.EventArgs e)
{
Thread t = new Thread(new ThreadStart(myFunction));
t.Start();
}

private void myFunction ()
{
for (int i=0; i<=100; i++)
progressBar1.Value = i;
}

So, when I run application and click to the button the thread starts and
progress bar is filling but about 30 (or sometimes other) stage its stops
and application don't responses on any action. But when I do it not in
Compact Framework all works fine.

What can I do to solve this problem?
Can you show me some example or demo please?
 
You MUST use a Control.Invoke if you're updating the UI from a different
thread.
 
Alex, could u please show an example of how to use this Control.Invoke

Thx in Advance :)
 
Back
Top