Violeta Popa

Violeta Popa

  • NA
  • 137
  • 164k

cannot use ShowDialog()

Apr 11 2013 8:08 AM
Hello..I have a form, named "modificare" which i want to be shown in a panel, so I used the Parent property.If i use Show() is ok, but using ShowDialog() generates an error: Form that is not a top-level form cannot be displayed as a modal dialog box. Remove the form from any parent form before calling showDialog. But i need ShowDialog :( how can i fix this pb? thanks.

            modificare.TopLevel = false;
            modificare.Parent = panel3;
            panel3.Controls.Add(modificare);
            modificare.ShowDialog();

Answers (3)