You need to open the properties that you want to change in your user control. For example, to change the column counting property of a table table control, from your user control you must open the ColumnCount property:
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
public int ColumnCount
{
get
{
return this.tableLayoutPanel1.ColumnCount;
}
set
{
this.tableLayoutPanel1.ColumnCount = value;
}
}
}
Then you can also use some attributes to control the display of the user control in Visual Studio, for example, the above can be changed as follows:
[DefaultProperty("ColumnCount")]
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
[Description("Gets or sets the column count of the table layout.")]
[Category("TableLayout")]
[DefaultValue(2)]
public int ColumnCount
{
get
{
return this.tableLayoutPanel1.ColumnCount;
}
set
{
this.tableLayoutPanel1.ColumnCount = value;
}
}
}
"ColumnCount" count , 2 , . , .