Answers for "use Multiple forms in one Csharp panel in one Windows Form panel"

C#
0

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();
Posted by: Guest on May-06-2022

C# Answers by Framework

Browse Popular Code Answers by Language