2 Replies - 4791 Views - Last Post: 03 April 2009 - 05:13 PM Rate Topic: -----

#1 rajnivas  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 02-April 09

HOW TO CLOSE MDI FORM FROM CHILD FORM

Posted 03 April 2009 - 06:49 AM

hi,
i am working in windows application.How to close MDI form from child form.
with regards,
rajnivas
Is This A Good Question/Topic? 0
  • +

Replies To: HOW TO CLOSE MDI FORM FROM CHILD FORM

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: HOW TO CLOSE MDI FORM FROM CHILD FORM

Posted 03 April 2009 - 03:13 PM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 induster  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 20
  • Joined: 01-March 09

Re: HOW TO CLOSE MDI FORM FROM CHILD FORM

Posted 03 April 2009 - 05:13 PM

Are you trying to close the parent container from the child form? Or are you trying to close a child from from another child form?

You have to declare the form in the form your trying to close it from. so:
class ParentForm()
{
	 private Form ChildForm;
	 public ParentForm()
	 {
		  ChildForm = new Form();
		  ChildForm.MdiParent = this;
	 }
{



Now, you can call childform.dispose() from within that form

Funny, because I just wrote this up for a classmate.

Please, I am a student myself, so if there is a better way, enlighten us.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1