Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

showdialog

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lukasz - 05 Sep 2004 02:56 GMT
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?
Sijin Joseph - 05 Sep 2004 05:43 GMT
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

> 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?
Herfried K. Wagner [MVP] - 05 Sep 2004 12:18 GMT
* "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...

Signature

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

lukasz - 05 Sep 2004 16:32 GMT
hah.. I wasn't aware of the parameterless version of the method. According
to the specs it's what I wanted -- thanks.

> * "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...

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.