Top-level control cannot be added to a control?

B

Bruce

I am starting my first C## project. In one of my menu events I have the
following:

UserProfile winProfile = new UserProfile();
winProfile.Parent = this;
winProfile.Show();


UserProfile is a form, this is a MDI form.

When I do this, I get the error:

Top-level control cannot be added to a control

I also tried:

UserProfile winProfile = new UserProfile();
winProfile.Show(this);


Which shows user profile but not within the parent.


I did a search on this error butdid not find anything that applies.


What am I doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top