3
Answers

cannot use ShowDialog()

Violeta Popa

Violeta Popa

11y
2.4k
1
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)