RadRibbonForm Closing Child and Form1

6 posts, 1 answers
  1. Robert Canal
    Robert Canal avatar
    17 posts
    Member since:
    Mar 2010

    Posted 27 Sep 2010 Link to this post

    I am new to Windows Form application, I normally right web apps. so sorry to sound stupid.

    I have a login window ("ShapedForm") that Opens a RadRibbonForm. 

    RadRibbonForm1 FRM1 = new RadRibbonForm1()
    FRM1.Show();
    this.Hide();

    Problem is, if you click the "x" in the upper right corner the RadRibbonForm it closes the Form but the "ShapedForm" (Hidden) stayes open. Can you help me fix it so if the "x" on any of the child forms it kills the application.

    Thanks
  2. Robert Canal
    Robert Canal avatar
    17 posts
    Member since:
    Mar 2010

    Posted 27 Sep 2010 Link to this post

    I found a hecked way to do what I want, but if anyone has a better solution please let me know.....

    On my Login in button i added

    RadRibbonForm1 frm2 = new RadRibbonForm1();
    frm2.FormClosed += new FormClosedEventHanddler(frm_FormClosed);
    frm2.Show();
    this.Hide();

    private void frm2_formClosed(object sender, FormClosedEventArgs e)
    {
    this.Close();
    }

    Thanks to
    www.dotnetcurry.com/ShowArticle.aspx?ID=125&AspxAutoDetectCookieSupport=1
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 30 Sep 2010 Link to this post

    Hi Robert Canal,

    Thank you for sharing your solution.

    You can also use our approach - it completely covers your scenario.

    Do not hesitate to contact us if you have other questions.

    Greetings,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Robert Canal
    Robert Canal avatar
    17 posts
    Member since:
    Mar 2010

    Posted 03 Oct 2010 Link to this post

    Can you please point me to Teleriks approch at solving this issue?  I would like to see what it is.

    Thanks
  6. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 05 Oct 2010 Link to this post

    Hello Robert,

    I can suggest a very simple yet brutal solution to this problem, if you are sure you want to close the entire application, you can just use:
    Environment.Exit(0);

    This will close everything, always.

    But i have to emphasize this is a brutal solution, if you need any more data from the child form before closing i would recommend using your the solution you already found or one of the many solutions available out there.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  7. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 07 Oct 2010 Link to this post

    Hello Robert Canal,

    Thanks for getting back to us.

    Please, look into the FormClosed event - it should provide you with a solution to your problem. Note that our forms are very close to the standard forms in terms of functioanlity, so if you are able to do this with a standard windows form, the approach will also work for us.

    Don't hesitate to contact us if you have other questions.

    Greetings,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready