tablelayoutpanel into usercontrol

M

Michael

Dear Experts :

When I put the tablelayoutpanel into usercontrol and allow other developer
adjust row / column size into design time (so that they use mouse to adjust
inner controls layout).
How to do it ?

another question , if usercontrol inside contain 4 other control (like
textbox, label ..etc) how to explore one of control (like textbox) property
explorer
into design time.

Can anyone tell me


Thanks

Michael
 
D

Davita

Hi Michael
1 and 2) You'll have to map subcontrols in public properties, so in the
properties window you will see your labels and textbox controls.

public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}

public TextBox nameTextBox { get { return textBox1; } }
public Label nameLabel { get { return label1; } }
}

This approach won't let you resize tablelayoutpanel with mouse in the
designer, but it will let you modify it's properties through properties
window. If you really need to modify row/column size in design time, you'll
have to create a design-time service for your control. look for
DesignerAttribute class in MSDN.
 
M

Michael

Thanks for your help
Davita said:
Hi Michael
1 and 2) You'll have to map subcontrols in public properties, so in the
properties window you will see your labels and textbox controls.

public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}

public TextBox nameTextBox { get { return textBox1; } }
public Label nameLabel { get { return label1; } }
}

This approach won't let you resize tablelayoutpanel with mouse in the
designer, but it will let you modify it's properties through properties
window. If you really need to modify row/column size in design time,
you'll have to create a design-time service for your control. look for
DesignerAttribute class in MSDN.
 

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

Top