mdi form-->> child form 1(button-->> child form2) c # child form from button of some other child form

StackOverflow https://stackoverflow.com/questions/23416964

  •  13-07-2023
  •  | 
  •  

Frage

i have mdi form "m1" in which OnLoad open child form "ch1" in child form i have one button "b1" which further open new form "ch2" but that form should be the child of "md1" ch2.MdiParent = this; is not working form me

War es hilfreich?

Lösung

Since Child Form 2 is being created by Child Form 1, it needs to reference the MdiParent of Child Form 1, not this (which is not an MDI form):

ch2.MdiParent = this.MdiParent;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top