473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Hiding dialog causes ShowDialog to return

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.
Nov 30 '06 #1
2 2100
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).

Nov 30 '06 #2
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.

"Robinson" <to******************@myinboxtoomuchtoooften.comwr ote in
message news:ek*******************@news.demon.co.uk...
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).

Nov 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Bowman | last post by:
Hi, I need some dialog handling help, I must be missing something obvious here but I can't figure out the solution to the following problem... Simple Win Forms app that has button on the form....
2
by: Mark Broadbent | last post by:
I know this has been discussed before, but rather than spend ages trawling through old threads I thought I would start a new *quick* Q&A thread. Q. What is the preferred method for returning data...
6
by: bryanhobson | last post by:
I'm fairly new to c#, and I am just trying to work out how a 'properties' dialog works. Currently in my code, I have an object represented by the class 'Dog'. The dog object has several...
4
by: ronenk | last post by:
I have this code to load an authentication form once my app is loaded. I want the authentication form to be closed if a user is authenticated successfully and to give the option to close app on his...
4
by: Tony Vitonis | last post by:
Hello. I've written an app that I want to "live" in the system tray. I want it to start up with just a tray icon showing, and if the user selects "Settings..." from the icon's context menu, to...
14
by: Simon Abolnar | last post by:
I would like to know how to open child form from dialog form. Thanks for help! Simon
2
by: Bob | last post by:
Hi, I have an app that requires 4 child forms each created on a separate thread. Each form holds a 3rd Party Phone answering control. The control will only answer the phone if the form has been...
2
by: Brad Pears | last post by:
I have some sample code that uses the print dialog, print preview and a print direct options. If I select print preview and then click the printer icon from that, the document prints. If I...
7
by: Masterfrier | last post by:
Hi there! in my app, i open a Dialog, in this dialog i use the FileOpenDialog, when i click on 'Ok' or 'Cancel' in my FileOpenDialog, it automatically closes the parent dialog, with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.