Modal Forms

  • Thread starter Thread starter Pooja Narang
  • Start date Start date
P

Pooja Narang

Hi,

I have vb.net windows application where in i am opening a modal form-
SubForm1 from MainForm1 (Not an MDIParent). When I switch over to another
application such as IE Browser window and get back to my application, the
modal form appears on top of the IE Browser window and not as a part of
MainForm1. I want the SubForm1 to always appear on top of MainForm1. I have
tried the following options:

I tried to set the owner of SubForm1 as MainForm1.
I also set the FormBorderStyle property of both MainForm1 and SubForm1 to
FixedSingle, but it didnt work.
When I tried to set the FormBorderStyle property to SizeableToolWindow,
SubForm1 comes always on top of MainForm1 but My Application is not visible
in ALT+TAB. It becomes accessible only through Taskbar.

Please let me know what property needs to be set to get the SubForm1 always
on top of MainForm1 and also the application should be accessible through
ALT+TAB.

Regards,
Pooja
 
Pooja said:
Hi,

I have vb.net windows application where in i am opening a modal form-
SubForm1 from MainForm1 (Not an MDIParent). When I switch over to another
application such as IE Browser window and get back to my application, the
modal form appears on top of the IE Browser window and not as a part of
MainForm1. I want the SubForm1 to always appear on top of MainForm1. I have
tried the following options:

I tried to set the owner of SubForm1 as MainForm1.
I also set the FormBorderStyle property of both MainForm1 and SubForm1 to
FixedSingle, but it didnt work.
When I tried to set the FormBorderStyle property to SizeableToolWindow,
SubForm1 comes always on top of MainForm1 but My Application is not visible
in ALT+TAB. It becomes accessible only through Taskbar.

Please let me know what property needs to be set to get the SubForm1 always
on top of MainForm1 and also the application should be accessible through
ALT+TAB.

Regards,
Pooja

In the ShowDialog method add the parameter "me" (not in quotes) so that
the calling form is the parent of the modal dialog. Then you will see
the behaviour you are looking for.

LS
 
Lloyd Sheen said:
In the ShowDialog method add the parameter "me" (not in quotes) so that
the calling form is the parent of the modal dialog. Then you will see
the behaviour you are looking for.

LS

Hi ,

I tried ShowDialog(me) but it didnt work. Is there any other solution?

Thanks and Regards,
Pooja
 
Back
Top