Robinson Niit

Robinson Niit

  • NA
  • 2
  • 5.3k

C#-WinForm - How to close parent form when child is closed?

Apr 14 2015 2:19 AM

This is my issue:

I have 3 forms:

  • Form fParent
  • Form fChild (is child of fParent)
  • Form OpenForm (contains a button A)

I want that When I click button A on fChild, it shows OpenForm , hides fParent and fChild.

How can I do that?

 //code on fChild
OpenForm frm = new OpenForm();
this.Hide();
frm.Show()

Please help me.

Answers (1)