Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am developing a custom usercontrol that is really just a panel with two images on top and a drop down menu.

 

The panel is divided into two parts, the top where the images are and the rest where the user should be able to drop controls.

 

I've made the control and used the parentcontroldesigner class to implement a designer. But the control doesn't behave correctly at all.

 

Design mode: The controls that are added are placed behind the control and I must use "bring to front" to see them correctly.

 

Run mode: The added controls aren't visible, just the container control.

 

I've searched all over MSDN and these forums and still haven't found something that I can use.

 

Any help would be greatly appreciated!

 

Best regards,

 

Christer Nordvik

 

 

Here is a picture of the design mode to illustrate what I'm trying to do. The button is in front just because I've used "bring to front".

  • *Gurus*
Posted

You screwed something up somewhere. Simply applying the below attribute to your usercontrol class will make it behave like a control container (like a Panel).

 

<System.ComponentModel.Designer(GetType(System.Windows.Forms.Design.ParentControlDesigner))>

 

[system.ComponentModel.Designer(typeof(System.Windows.Forms.Design.ParentControlDesigner))]

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...