26 Temmuz 2012 Perşembe

access to main form from child fom (WinForms)

Assume ChildForm is opened from MainForm:


ChildForm form= new  ChildForm  ();
form.ShowDalog(this);


Now, to access MainForm from ChildForm (to refresh something on MainForm etc.), call this from child form:


MainForm parent = ( MainForm  )this.Owner;
// do sonething in parent form
this.Close(); // close child form



http://stackoverflow.com/questions/5443932/accessing-main-form-from-child-form

Hiç yorum yok:

Yorum Gönder