Hi,
I have a form (say FormB) on which i have opened a font dialog. There
are situations when i need to close FormB, from another form (say
FormA) in my application. i am calling FormB.Close(), but the form
doesn't close. The moment i close the Font Dialog, FormB gets closed.
(Also, I observe the same behavior when i open other forms using
ShowDialog from FormB)
I need to find a way so that FormB closes as soon as i call
FormB.Close();
Regards,
Ankit
Andy - 21 Mar 2008 14:55 GMT
On Mar 21, 6:41 am, aagarw...@gmail.com wrote:
> Hi,
>
[quoted text clipped - 10 lines]
> Regards,
> Ankit
I don't think this is possible. The only way it would work is if you
could somehow tell the modal dialog to close, and I'm not sure of a
way to get that.
aagarwal8@gmail.com - 24 Mar 2008 07:23 GMT
> On Mar 21, 6:41 am, aagarw...@gmail.com wrote:
>
[quoted text clipped - 16 lines]
> could somehow tell the modal dialog to close, and I'm not sure of a
> way to get that.
Any, i have opened FormB on a separate thread. so i can have FormB
blocked with a modal dialog, but can still work on FormA (and thereby
initiate a close of FormB)
Regards,
Ankit
Peter Duniho - 24 Mar 2008 08:22 GMT
>> I don't think this is possible. The only way it would work is if you
>> could somehow tell the modal dialog to close, and I'm not sure of a
[quoted text clipped - 3 lines]
> blocked with a modal dialog, but can still work on FormA (and thereby
> initiate a close of FormB)
Be that as it may, I agree with Andy that closing another form that's
otherwise blocked by a modal dialog is not in keeping with the very
excellent user-interface design "rule of least surprise".
If you really want to do this, you need to close the modal dialog first
(as Andy already said). Then you can close the form that opened the modal
dialog. Not that this is all that much nicer to the user, but at least
it's less surprising than a form underneath a modal dialog disappearing
while the modal dialog sticks around doing who knows what.
Pete
aagarwal8@gmail.com - 25 Mar 2008 12:05 GMT
On Mar 24, 12:22 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> >> I don't think this is possible. The only way it would work is if you
> >> could somehow tell the modal dialog to close, and I'm not sure of a
[quoted text clipped - 15 lines]
>
> Pete
Pete,
I dont just want to close the FormB, but also the modal dialog/form
blocking it.
So it will never be a situation that the form disappears from the
background, and the modal window stands thr orphaned.
Ankit!
Peter Duniho - 25 Mar 2008 17:39 GMT
> I dont just want to close the FormB, but also the modal dialog/form
> blocking it.
Then perhaps you could be more clear about what's giving you trouble.
Posting a concise-but-complete code sample would be a good starting
point. What about closing the two forms are you having a hard time
figuring out?
Pete
ignacio machin - 21 Mar 2008 15:39 GMT
On Mar 21, 6:41 am, aagarw...@gmail.com wrote:
> Hi,
>
[quoted text clipped - 10 lines]
> Regards,
> Ankit
Hi,
if the dialog is modal, how are you gonna clse it from another form?
Not only that, but IMHO closing a form without the user consent (or as
a response to an user action) is rude, very rude