Different thread for window forms/mdi childs/user controls

R

Rajat

Hi,

I have a MDI application. Right now I am applying the threading in my
application to make it faster. I have some of the doubts regarding that.
Please clarify.

1. Are the childs of the MDI parent open in different thread or the same UI
thread?
2. Is it ok if I want to open multiple MDI child windows on their individual
threads?
3. If I place some user control on the form. Will that be on a different
thread?
4. Can I place the UI related functionality of User Control on a separate
thread and it it ok to do so?


Regards,
Rajat Tandon.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Rajat,

There is one simple answer for your question and that's it - Controls cannot
parent controls that are created in different thread. In other words you
cannot have user controls created in different thread nor MDI chidren
created in different threads as well as only the thread created the control
can modify its properties and call its methods. The latter is good to know
as a rule of a thumb event though some methods and propeties could be called
across threads.
 

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

Top