I have 3 TableLayoutPanels
iPanel_1(inner bigger panel) and iPanel_2 (smaller).
What I want is:
When user presses some button, the iPanel_2 should hide and iPanel_1 (with all the control it contains with Dock=fill option)
should overshadow the display part which was owned previously by iPanel_2.
void btnMainView_Click(object sender,
Size oldSz_iPanel_1 =
new Size(iPanel_1.Width, iPanel_1.Height);
Size newSz_iPanel_1 =
new Size(iPanel_1.Width, iPanel_1.Height + iPanel_2.Height);
//This will hide the innerPanel-2
HidePanelRowColumn(iPanel_2, 0, 0,
//This code should actually resize the iPanel_1 to overshadow iPanel_2.
iPanel_1.Size = newSz_iPanel_1;
void HidePanelRowColumn(TableLayoutPanel panel,
int colIndex, int rowIndex,
panel.GetControlFromPosition(colIndex, rowIndex).Visible = visibility;
Even when I assign: iPanel_1.Size
= newSz_iPanel_1, the Size of iPanel_1 remains as it was.
Am I missing something?
View Complete Post