Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i guess i have a weird question like ki, how can i get the count of the controls present in a groupbox. Suppose there are some 20 controls say 10 of them are textboxes, 5 are comboboxes and 5 are labels. I want the count of number of controls present in a groupbox.

Dim j As Integer = 0

            For Each cntrl As Control In gbLeadSelection.Contains

            Next


is it possible to take like the above mentioned for loop?

Pls help me out in this.


thanks in Advance :)

regards
Tirumal
+91 9986761000
Posted

1 solution

All you need to do is use the count property of the GroupBoxes Controls Collection. i.e

VB.NET
Dim intControlCount As Integer = GroupBox1.Controls.Count


Hope this Helps

Happy Coding
 
Share this answer
 
Comments
tirumal reddy 27-May-10 7:36am    
Thanx it works

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