1
Reply

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

Robinson Niit

Robinson Niit

Apr 14 2015 2:19 AM
1.3k

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)