change TableLayoutPanel RowCount before Custom Control Initialization?
-
Hi, all, In WinForms with C#, a TableLayoutPanel custom control with, saying, 10 rows and 5 columns being designed in designer window.
NumberOfRows
was coded as a property of this custom control. I wish to change this property value and set it as a new RowCount of the TableLayoutPanel mentioned above, before the custom control runningInitializeComponent()
. Is this possible? I have tried to do it with a method in the SET of that property as below:private void OnNumberOfRowsChanged()
{
tableLayoutPanel1.RowCount = numberOfRows;
}and it didn't work while I change the value of
NumberOfRows
property, and set a breakpoint in the constructor method of that custom control, the RowCount remains as 10. Btw, I tried to usetableLayoutPanel1.RowStyles.Remove()
andtableLayoutPanel1.RowStyles.RemoveAt(index)
as well, neither of these two works as well... Any Idea? Your kind help is so much appreciated!! Br! Sun