Form refresh/redraw issue

  • Thread starter Thread starter Ollie
  • Start date Start date
O

Ollie

Hi,

I'm new to C# so please be patient with me.

Ok, I have a small app that analyses the content of about 10,000 log files.
The application works fine and outputs the expected results. But I need a
form that displays the status of the job it is running so the guy's using it
now it is working etc.

So, the problem is that if I don't touch the PC while it is running this app
the progress bar a label are updated fine. But if the form looses focus or I
click on the form it stops updating. The app continues and finishes without
problems although the status form becomes useless.

Hope that makes sense.

Ollie (C# Rookie)
 
Hi Ollie,

One solution for you would be create a working thread that send an event to
the interface each time a new file start to process you need to use
Control.Invoke to send the event to the main thread. I have some code aroud
that do this, just let me know if you need it.


Cheers,
 
Ignacio,

That would be great. I was thinking that having separate threads was the
best way to go.

Thanks for you response and the sample code would be very helpful.

Ollie

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message Hi Ollie,

One solution for you would be create a working thread that send an event to
the interface each time a new file start to process you need to use
Control.Invoke to send the event to the main thread. I have some code aroud
that do this, just let me know if you need it.


Cheers,
 
Back
Top