Advertisement

11.11.2007 at 08:19PM PST, ID: 22953768
[x]
Attachment Details

C# Winform  Parent property

Asked by AdibRahman77 in Microsoft Visual C#.Net, C# Programming Language, .NET Framework 2.0

Tags: parent, form, winforms

I am instantiating a child form  e.g
1.EnterColor colorform=new EnterColor();
2.colorform.Parent = this; //this is the current
3.colorform.Show();
It gives me error at line 2 \
{"Cannot add a top level control to a control." }

Basically I need do some calculation in the child form and after a certain event in the child I want close both the child and parent forms.
So I was trying to set the Parent for the child form.But this gives error.
How do I achieve this?

Thanks in Advance
Start Free Trial
[+][-]11.11.2007 at 08:33PM PST, ID: 20262100

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.11.2007 at 08:50PM PST, ID: 20262143

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.15.2007 at 09:22AM PST, ID: 20290637

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, C# Programming Language, .NET Framework 2.0
Tags: parent, form, winforms
Sign Up Now!
Solution Provided By: ventaur
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628