Untitled
By: a guest | Mar 22nd, 2010 | Syntax:
C# | Size: 0.85 KB | Hits: 71 | Expires: Never
private void changePanel(UserControl customControl)
{
try
{
foreach (Control c in tableLayoutPanelMain.Controls.Cast<Control>().Where((c) => tableLayoutPanelMain.GetRow(c) == 1))
{
// Unload current control in panel
tableLayoutPanelMain.Controls.Remove(c);
// Set customControl as content of panel
tableLayoutPanelMain.Controls.Add(customControl);
// Set lableTitle
labelTitle.Text = customControl.Name;
MessageBox.Show("Test");
}
// Refresh TableLayoutPanelContainer
tableLayoutPanelMain.Refresh();
}
catch (Exception e)
{
}
}