473,473 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

New thread

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.

Sep 26 '07 #1
5 1585
On Sep 26, 9:11 am, RP <rpk.gene...@gmail.comwrote:
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

Sep 26 '07 #2
RP
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.

On Sep 26, 1:13 pm, "Jon Skeet [C# MVP]" <sk...@pobox.comwrote:
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.

Sep 26 '07 #3
On Sep 26, 9:26 am, RP <rpk.gene...@gmail.comwrote:
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

Sep 26 '07 #4
RP
Can you please illustrate how to initialize a new thread?

On Sep 26, 1:29 pm, "Jon Skeet [C# MVP]" <sk...@pobox.comwrote:
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.

Sep 26 '07 #5
On Sep 26, 9:32 am, RP <rpk.gene...@gmail.comwrote:
Can you please illustrate how to initialize a new thread?
I suggest you read my threading tutorial:
http://pobox.com/~skeet/csharp/threads/

Jon

Sep 26 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: adeger | last post by:
Having trouble with my first forays into threads. Basically, the threads don't seem to be working in parallel (or you might say are blocking). I've boiled my problems to the following short code...
4
by: Gilles Leblanc | last post by:
Hi I have started a small project with PyOpenGL. I am wondering what are the options for a GUI. So far I checked PyUI but it has some problems with 3d rendering outside the Windows platform. I...
7
by: Ivan | last post by:
Hi I have following problem: I'm creating two threads who are performing some tasks. When one thread finished I would like to restart her again (e.g. new job). Following example demonstrates...
4
by: Matthew Groch | last post by:
Hi all, I've got a server that handles a relatively high number of concurrent transactions (on the magnitude of 1000's per second). Client applications establish socket connections with the...
5
by: Razzie | last post by:
Hi all, A question from someone on a website got me thinking about this, and I wondered if anyone could explain this. A System.Threading.Timer object is garbage collected if it has no...
16
by: droopytoon | last post by:
Hi, I start a new thread (previous one was "thread timing") because I have isolated my problem. It has nothing to do with calling unmanaged C++ code (I removed it in a test application). I...
9
by: mareal | last post by:
I have noticed how the thread I created just stops running. I have added several exceptions to the thread System.Threading.SynchronizationLockException System.Threading.ThreadAbortException...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
7
by: Charles Law | last post by:
My first thought was to call WorkerThread.Suspend but the help cautions against this (for good reason) because the caller has no control over where the thread actually stops, and it might have...
3
by: John Nagle | last post by:
There's no way to set thread priorities within Python, is there? We have some threads that go compute-bound, and would like to reduce their priority slightly so the other operations, like...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.