Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Make panel on usercontrol container
 

Make panel on usercontrol container

Im creating a userControl called MainControl, which has a header panel used just to display images and text, and a button panel where i add other controls.
In Design-Time i try to drag controls and drop them into the button panel bu this controls are not added to this panel.
I want to know iof there is a way to make just my button panel a container??
hajrodriguez  Tuesday, June 16, 2009 8:09 PM
Part of the solution is to give the UserControl another designer:

[DesignerAttribute(typeof(ParentControlDesigner), typeof(IDesigner))]
public partial class UserControl1 : UserControl {
//...
}

That allows you to do drop controls on it. Doing this for the nested Panel is however a long shot. Maybe you don't really need it? You can display images and draw text directly on the UserControl surface too.

Not a BCL q, moved to Windows Forms Designer.

Hans Passant.
nobugz  Tuesday, June 16, 2009 8:27 PM
Part of the solution is to give the UserControl another designer:

[DesignerAttribute(typeof(ParentControlDesigner), typeof(IDesigner))]
public partial class UserControl1 : UserControl {
//...
}

That allows you to do drop controls on it. Doing this for the nested Panel is however a long shot. Maybe you don't really need it? You can display images and draw text directly on the UserControl surface too.

Not a BCL q, moved to Windows Forms Designer.

Hans Passant.
nobugz  Tuesday, June 16, 2009 8:27 PM

You can use google to search for other answers

Custom Search

More Threads

• Design Issue with TypeConverter for a Collection Item.
• Component become invisible in designtime
• UserControl in IE taking a long time with Async Events
• Can you edit the path the designer uses for relative pathing for visual controls?
• AutoToolboxPopulate option question
• For Next Statement
• How can i make a form with no formborderstyle movable?
• Form lost objects in design window
• Digital Signature Verification using Certificate data in C#.
• Form Events : need a Controlchange event