473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Top-level control cannot be added to a control?


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?

Apr 15 '07 #1
2 24416
winProfile.Parent = this;

winProfile.MdiParent = this;

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
Apr 15 '07 #2
Mick Doherty wrote:
>
winProfile.MdiParent = this;
Thanks
Apr 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

145
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity...
0
by: Ataru Morooka | last post by:
Hello, I am renewing a website using CSS and I have some problems with IE6. Following this link: http://www.ansv.it/templates/Template_Index_IT.dwt.asp you may notice that the container area has...
19
by: Mason A. Clark | last post by:
How was I to know that "top" means "top" in MSIE6 ?? I was testing <a name="top"></a> at the top of the page with <a href="#top>go to top</a> at the bottom of the page. It always worked in...
6
by: Mason A. Clark | last post by:
LAST WORD(s): 1. MSIE6 and Firefox will go to the top of the page on command <a href="#top">go upsy</a> even if there is NO name="top" or id="top" They know what a "top" is :-) Opera...
4
by: John Herndon | last post by:
I have a VB.Net application that reads from a SQL database (SQL Server 7.0). How do I get the top 50% or bottom 50% of records from a certain table for my dataset? I keep getting an exception...
23
by: Antoon Pardon | last post by:
I know this PEP is rejected. However I have a problem that would benefit from having extreme values and the sample implementation that is given in the PEP is unsatifactory for my purpose. I had...
4
by: BerkshireGuy | last post by:
Hello: tblDetails has the following fields: AgencyCode, ProducerCode, AnnualPX How can I create a query to show the Top 5 producers per agency with the highest
2
by: levilarsen | last post by:
Hi, thanks for reading this post. I have a web page that displays fine in IE but in Firefox and Safari there is a space at the top of the web page. It is as if the whole page is pushed down, like...
27
by: Alan T | last post by:
I am not sure which way to go: Want to learn C# but C# is implemented both in Windows desktop application and ASP.NET. I am not familiar with web programming, should I start with Windows app or...
36
by: Neil | last post by:
I received a message in another newsgroup saying that I shouldn't top-post my replies. I always top-post, because I feel it's easier for the reader to see the reply, rather than having to go to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.