New thread

  • Thread starter Thread starter RP
  • Start date Start date
R

RP

I have an animated GIF image on a Form. By default this image is
"invisible". I want to show this image using a different thread. How
to create a new thread and show this image.

I mean where to write Image.Show() in thread procedure.
 
I have an animated GIF image on a Form. By default this image is
"invisible". I want to show this image using a different thread. How
to create a new thread and show this image.

I mean where to write Image.Show() in thread procedure.

Why do you want to use a different thread? You shouldn't use multiple
threads "owning" controls within a single window. You could load the
data for the GIF in a separate thread, and then ask the UI thread to
display it, but that's slightly different.

Jon
 
This is because my main thread is performing a tedious database task.
I tried to show it before the job starts, but it is not visible until
the process finishes or stops in between.
 
This is because my main thread is performing a tedious database task.

Well *that's* the thing to move onto a different thread then. You
shouldn't block the UI thread with long-running tasks - they should be
executed on a different thread, with control updates being performed
on the UI thread using Control.Invoke or Control.BeginInvoke.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top