How to programatically close a form which has a Font/Color Dialogopened

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aagarwal8@gmail.com

    How to programatically close a form which has a Font/Color Dialogopened

    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

    #2
    Re: How to programatically close a form which has a Font/Color Dialogopened

    On Mar 21, 6:41 am, aagarw...@gmail .com wrote:
    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
    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.

    Comment

    • ignacio machin

      #3
      Re: How to programatically close a form which has a Font/Color Dialogopened

      On Mar 21, 6:41 am, aagarw...@gmail .com wrote:
      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
      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

      Comment

      • Peter Duniho

        #4
        Re: How to programatically close a form which has a Font/Color Dialog opened

        On Tue, 25 Mar 2008 04:05:43 -0700, <aagarwal8@gmai l.comwrote:
        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

        Comment

        Working...