use Multiple forms in one Csharp panel in one Windows Form panel

57

use Multiple forms in one Csharp panel in one Windows Form panel -

subForm = new SubFormYouWantToLoad();
            subForm.TopLevel = false;
            subForm.FormBorderStyle = FormBorderStyle.None;
            ContainerPanel.Controls.Add(subForm , 0, 1);
            subForm .Visible = true;

// You can add this code when you click on the specific button. 
// Here each subform is added to the Panel as a Control. 
// You should remove the subform from the panel's control list before 
// adding another subform. For this ,it is better to remove,close and 
// dispose the first one.

ContainerPanel.Controls.Remove(activeform);
activeform.Close();
activeform.Dispose();

Comments

Submit
0 Comments