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 / Languages / VB.NET / November 2006

Tip: Looking for answers? Try searching our database.

Hiding dialog causes ShowDialog to return

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NickP - 30 Nov 2006 10:24 GMT
Hi there,

   I was wondering if there was any way to stop the hiding of a dialog from
returning from the ShowDialog function?

   i.e. If you create your own dialog and put some code in that hides it
temporarily during it's use, the ShowDialog function will return the second
it is hidden, this is the same for ".Hide()" as well as sending
ShowWindow(...SW_HIDE).

   Many thanks in advance!

Nick.
Robinson - 30 Nov 2006 10:56 GMT
Hiding a dialog you have shown with ShowDialog obviously causes it to return
because ShowDialog is Modal (modal dialog is one which blocks input to all
other toplevel windows).  What you want to do is "Show" the dialog, but to
hold a reference to it in your form class, otherwise it will dissapear when
it gets disposed (on exit from the method which created it).
NickP - 30 Nov 2006 12:17 GMT
Hi there,

   Yes I understand why it does it, but technically the form has not been
closed.  As a temporary "fix" I have moved the form offscreen while the user
finishes the operation.

   I was hoping I could have got around it without blocking the calling
thread manually but I guess I can't.  Many thanks for your advice.

Nick.

> Hiding a dialog you have shown with ShowDialog obviously causes it to
> return because ShowDialog is Modal (modal dialog is one which blocks input
> to all other toplevel windows).  What you want to do is "Show" the dialog,
> but to hold a reference to it in your form class, otherwise it will
> dissapear when it gets disposed (on exit from the method which created
> it).

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.