0
Answer

About Accessing or Retrieve all the controls in a window form

Photo of subash renganathan

subash renganathan

16y
2.1k
1
Hi,

   I want to get the controls inside a tab page or group box which is in a windows forms in C#.
Ex:
foreach(Controls ctrl in tabPage1.controls)
{
if(ctrl is Label)
{
my code is here
}
}
Above code is the written by me for accesing Label Controls in my form.But i cant retreive Label Control Because it is inside the tabpage.
Is there any solution for this without specifying Groupbox1.Controls or tabpage1.controls

Plesae help me with the code

Thanks
Subash

Answers (0)