Click here to Skip to main content
15,914,013 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: How to make a control as a child to user control but not for a form? [modified] Pin
BillWoodruff28-Jun-09 23:20
professionalBillWoodruff28-Jun-09 23:20 
AnswerRe: How to make a control as a child to user control but not for a form? Pin
dan!sh 29-Jun-09 0:03
professional dan!sh 29-Jun-09 0:03 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk29-Jun-09 0:57
honey.rpk29-Jun-09 0:57 
GeneralRe: How to make a control as a child to user control but not for a form? [modified] Pin
BillWoodruff29-Jun-09 2:30
professionalBillWoodruff29-Jun-09 2:30 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
dan!sh 29-Jun-09 2:47
professional dan!sh 29-Jun-09 2:47 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
BillWoodruff29-Jun-09 3:38
professionalBillWoodruff29-Jun-09 3:38 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
dan!sh 29-Jun-09 6:51
professional dan!sh 29-Jun-09 6:51 
AnswerRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute29-Jun-09 6:23
Henry Minute29-Jun-09 6:23 
Here is the first few lines of a UserControl of mine, that allows me to drop controls onto it at design-time.

[
Designer(typeof(ParentControlDesigner))
]
public partial class ExplorerPanel : UserControl
{
    private Image headerImage;
    private bool collapsible = true;
    private HeaderButton headerButton = null;
    private Rectangle imageRectangle = Rectangle.Empty;
    private Color panelColor;

    public ExplorerPanel()
    {
        InitializeComponent();

        // Set the following control styles so that we get more optimized/flicker-free drawing,
        // and the use of transparent back color, and act as a 'parent' control
        SetStyle(ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint |
            ControlStyles.UserPaint | ControlStyles.DoubleBuffer |
            ControlStyles.SupportsTransparentBackColor | ControlStyles.ContainerControl, true);

        // These are properties are overridden so that the user cannot set them.
        // They are not available in the designer
        this.BorderStyle = BorderStyle.None;
        this.BackColor = Color.Transparent;
        this.panelColor = Color.WhiteSmoke;

        this.SetupHeaderButton();
    }


I hope that there is enough here to enable you to get yours working properly

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk29-Jun-09 19:01
honey.rpk29-Jun-09 19:01 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute29-Jun-09 23:29
Henry Minute29-Jun-09 23:29 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk29-Jun-09 23:57
honey.rpk29-Jun-09 23:57 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 0:34
Henry Minute30-Jun-09 0:34 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk30-Jun-09 0:58
honey.rpk30-Jun-09 0:58 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 1:08
Henry Minute30-Jun-09 1:08 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 1:22
Henry Minute30-Jun-09 1:22 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk30-Jun-09 2:30
honey.rpk30-Jun-09 2:30 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 5:51
Henry Minute30-Jun-09 5:51 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
ice.cool 172930-Jun-09 20:23
ice.cool 172930-Jun-09 20:23 
GeneralRe: How to make a control as a child to user control but not for a form? [modified] PinPopular
Henry Minute30-Jun-09 6:26
Henry Minute30-Jun-09 6:26 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
dan!sh 30-Jun-09 6:39
professional dan!sh 30-Jun-09 6:39 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 8:20
Henry Minute30-Jun-09 8:20 
Generalattn. Henry : small suggestion : Re: How to make a control as a child to user control but not for a form? [modified] Pin
BillWoodruff30-Jun-09 19:11
professionalBillWoodruff30-Jun-09 19:11 
GeneralRe: attn. Henry : small suggestion : Re: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 22:57
Henry Minute30-Jun-09 22:57 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
BillWoodruff30-Jun-09 9:07
professionalBillWoodruff30-Jun-09 9:07 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk30-Jun-09 18:55
honey.rpk30-Jun-09 18:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.