Thursday, 29 August 2013

How to get all buttons and labels under splitContainer.Panel2

How to get all buttons and labels under splitContainer.Panel2

I want to get the background color of all buttons and labels under
splitContainer.Panel2. When I try it I discover I not success to run on
any control (under Panel2) I try this code:
foreach (Control c in ((Control)splitContainer.Panel2).Controls)
{
MessageBox.Show("Name: " + c.Name + " Back Color: " + c.BackColor);
}
How can I get all background colors of all labels and buttons under
splitContainer.Panel2 ?
EDIT:
I get only this meesage: "Name: panel_Right Back Color: Color [Transparent]"

No comments:

Post a Comment