This is a migrated thread and some comments may be shown as answers.

RadRibbonForm Closing Child and Form1

5 Answers 113 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Robert Canal
Top achievements
Rank 1
Robert Canal asked on 27 Sep 2010, 03:33 PM
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

5 Answers, 1 is accepted

Sort by
0
Robert Canal
Top achievements
Rank 1
answered on 27 Sep 2010, 07:07 PM
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
0
Peter
Telerik team
answered on 30 Sep 2010, 04:06 PM
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
0
Robert Canal
Top achievements
Rank 1
answered on 04 Oct 2010, 03:29 AM
Can you please point me to Teleriks approch at solving this issue?  I would like to see what it is.

Thanks
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 05 Oct 2010, 07:27 AM
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
0
Peter
Telerik team
answered on 07 Oct 2010, 05:25 PM
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
Tags
RibbonBar
Asked by
Robert Canal
Top achievements
Rank 1
Answers by
Robert Canal
Top achievements
Rank 1
Peter
Telerik team
Emanuel Varga
Top achievements
Rank 1
Share this question
or