User control with a panel in it

J

Jeremy Chapman

My user control has a button and a panel on it. I want the panel to size to
whatever size the control width and height properties dictate. how do I do
that?

So far this is what I have:

protected override void CreateChildControls()
{
base.CreateChildControls();
if (pPanel_m == null)
{
pPanel_m = new Panel();
pPanel_m.Width = this.Width;
pPanel_m.Height = this.Height;
pPanel_m.BorderWidth = 1;
pPanel_m.BorderColor = System.Drawing.Color.Black;
Controls.Add(pPanel_m);
}
}

this seems to work when viewed in the page, but I see nothing in the
designer. what other methods do I need to override?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top