Modal Windows

A

aagarwal8

Hi,

I have a main form, which i use to open secondary forms. From the
secondary form i need to open a Modal Window in such a way that, my
secondary form is blocked, but i can still access my main forms, and
open other secondary windows.

(An exact analogy for my problem is the Yahoo Messenger, where i can
open any number of chatwindows from the main messenger window; and
from the chat windows i can invoke the File Trasnfer option, which
opens a modal disalog. But even when the File Transfer dialog is
opened, i can still go to the main messenger window and open other
conversation windows)

Any suggestions on how to achieve this?

Regards,
Ankit!!
 
N

Nicholas Paldino [.NET/C# MVP]

Ankit,

The only way I can think of to do this would be to open the other
windows on other threads. This means that you will have to run message
pumps on those threads. Then, the calls to open a modal dialog should be
applicable for just the window on that thread.

Of course, make sure when making calls between windows, that you are
using the Invoke method. Since the windows are on other threads, all calls
you make to the UI in other threads needs to be marshaled to the correct UI
thread.
 
B

Bill McCarthy

One other possibility is to not show the dialog as modal, rather just show
it and set it's owner. When the dialog shows, it set's the owner's Enabled
property to false, and on close it sets it back to true.



Nicholas Paldino said:
Ankit,

The only way I can think of to do this would be to open the other
windows on other threads. This means that you will have to run message
pumps on those threads. Then, the calls to open a modal dialog should be
applicable for just the window on that thread.

Of course, make sure when making calls between windows, that you are
using the Invoke method. Since the windows are on other threads, all
calls you make to the UI in other threads needs to be marshaled to the
correct UI thread.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

I have a main form, which i use to open secondary forms. From the
secondary form i need to open a Modal Window in such a way that, my
secondary form is blocked, but i can still access my main forms, and
open other secondary windows.

(An exact analogy for my problem is the Yahoo Messenger, where i can
open any number of chatwindows from the main messenger window; and
from the chat windows i can invoke the File Trasnfer option, which
opens a modal disalog. But even when the File Transfer dialog is
opened, i can still go to the main messenger window and open other
conversation windows)

Any suggestions on how to achieve this?

Regards,
Ankit!!
 
C

christery

Any suggestions on how to achieve this?

A search on MDI might help? threading is a bit complicated... win dont
like modal/always on top if there are more than one
//CY
 

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