?
Solved

Usercontrol with Panel, need to act as container in IDE

Posted on 2006-04-26
7
Medium Priority
?
526 Views
Last Modified: 2008-02-01
Hi

I have a UserControl with a Label, docked to the top, and a Panel, docked to fill the rest of the control space.

Once the control is compiled and dropped onto a form I am unable to treat the Panel within the UserControl as a container, as i would be able to if i placed a Panel directly on the form, with a Label and another Panel within (same set up as the UserControl).

How would I go about enabling this functionality.

I have tried
    setting the Modifier for the Panel in the UserControl to Public
    inheriting from Panel rather than UserControl

Any and all information would be greatly appreciated
0
Comment
Question by:drabaecus
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:gena17
ID: 16542166
Once you put your UserControl on a form, you can't get Control's inside.
Your control is independent entity for the form. It behaves like any other Control of .NET.

If you want to add something to the Panel, add it when designing the UserControl.

Or you can inherit from the UserControl and add something in the derived UserControl.

Gena
0
 

Author Comment

by:drabaecus
ID: 16542250
Even during design time? The Panel control itself, and others, allow you to drag drop controls into them whilst designing the form in the IDE.

0
 
LVL 8

Expert Comment

by:gena17
ID: 16542767
Even during design time.
You can add control to Panel only from UserControl designer.

If you put the UserControl on a form, you can add controls to the UserControl, but not to the Panel.

But you can do it in run time, if you want.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:drabaecus
ID: 16574846
No i need to do it at design time, and here is the solution i found.

http://blogs.msdn.com/subhagpo/archive/2005/03/21/399782.aspx
0
 
LVL 8

Expert Comment

by:gena17
ID: 16575790
Great.

Like I wrote:
> Or you can inherit from the UserControl and add something in the derived UserControl.

Good luck!
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16613058
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month16 days, 4 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question