How many UI thread could a .NET Window Form application have?

M

Max

Hello all,

This is a basic question about windows form. But it has puzzled me for a
long time. Normally, A windows application based on .net frame has only one
UI thread. And other threads are work threads as I know. Could I create a
second UI thread on a new Form. If I created a modeless form, is this form
still running on the same UI thread?

Thanks,
Max
 
A

Arne Janning

Hi Max!

This is a basic question about windows form. But it has puzzled me for a
long time. Normally, A windows application based on .net frame has only
one UI thread. And other threads are work threads as I know. Could I
create a second UI thread on a new Form.

Sure, have a look at these two articles by Chris Sells:
Safe, Simple Multithreading in Windows Forms, Part 1
http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp

Safe, Simple Multithreading in Windows Forms, Part 2
http://msdn.microsoft.com/library/en-us/dnforms/html/winforms08162002.asp
If I created a modeless form, is this form still running on the same UI
thread?

I think so, yes.

Cheers

Arne Janning
 

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