Hi All,
Depending on used UserControls I need to calculate height of my Groupbox.
How can I count amount of UserControles I used in my Form?
thanx to all
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 16, 2013, 2:23 PM
int count = 0;
foreach (Control c in groupBox1.Controls)
{
if (c is UserControl) count++;
}
MessageBox.Show("There are " + count + " user controls");
ilhami caliskanPosted Aug 16, 2013, 2:28 PM