I want to show a modal dialog box at a moment when I don't know which form
of my application is focused, so I can't call ShowDialog(owner). Keeping
current form in a global variable would be troublesome. Other ideas?

Re: showdialog by Sijin

Sijin
Sat Sep 04 23:43:13 CDT 2004

Hi Lukasz,

The best solution currently for you would be to maintain a global list
of openforms. And when you want to call Showdialog loop through the
forms checking which one has focus.

Quite cumbersome approach i know. But it seems we will have to wait till
VB.Net 2005 to use My.Appliaction.OpenForms, until then i guess we will
have to roll our own.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph



lukasz wrote:
> I want to show a modal dialog box at a moment when I don't know which form
> of my application is focused, so I can't call ShowDialog(owner). Keeping
> current form in a global variable would be troublesome. Other ideas?
>
>

Re: showdialog by hirf-spam-me-here

hirf-spam-me-here
Sun Sep 05 06:18:58 CDT 2004

* "lukasz" <bbla32@op.pl> scripsit:
> I want to show a modal dialog box at a moment when I don't know which form
> of my application is focused, so I can't call ShowDialog(owner). Keeping
> current form in a global variable would be troublesome. Other ideas?

Simply don't pass an owner to the 'ShowDialog' method...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Re: showdialog by lukasz

lukasz
Sun Sep 05 10:32:20 CDT 2004

hah.. I wasn't aware of the parameterless version of the method. According
to the specs it's what I wanted -- thanks.


Uzytkownik "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> napisal w
wiadomosci news:OzABBpzkEHA.3968@TK2MSFTNGP11.phx.gbl...
> * "lukasz" <bbla32@op.pl> scripsit:
> > I want to show a modal dialog box at a moment when I don't know which
form
> > of my application is focused, so I can't call ShowDialog(owner). Keeping
> > current form in a global variable would be troublesome. Other ideas?
>
> Simply don't pass an owner to the 'ShowDialog' method...