Click here to Skip to main content
15,921,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi sir/madam,

may i know how to find the form that is displayed in splitcontainer1.panel2 . and also how to set that form backcolor at runtime.
I am not getting the way to solve this. if u don't mine may i know?


thank u...
Posted

Look at the splitContainer1.panel2.Controls collection - it lists all controls the panel will display.
 
Share this answer
 
try below:
C#
foreach (Control ctrl in splitcontainer1.panel2.Controls)
{
    if (typeof(ctrl) == typeof(Form1))
    {
    }
    else if (typeof(ctrl) == typeof(Form2))
    {
    }
    //else if ...
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900