如何获取组框中存在的对象(控件)的数量? [英] how can i get the count of objects(controls) present in a groupbox?

查看:130
本文介绍了如何获取组框中存在的对象(控件)的数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想我有一个像ki这样的怪异问题,我怎么能得到一个存在于groupbox中的控件的数量.假设有大约20个控件,其中10个是文本框,5个是组合框,5个是标签.我想要一个组框中存在的控件数.

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



是否可以像上述for循环那样使用?

请帮我解决这个问题.


在此先感谢:)

问候
股骨
+91 9986761000



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

Pls help me out in this.


thanks in Advance :)

regards
Tirumal
+91 9986761000

推荐答案

您需要做的就是使用GroupBoxes控件集合的count属性.即

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

Dim intControlCount As Integer = GroupBox1.Controls.Count



希望对您有帮助

快乐编码



Hope this Helps

Happy Coding


这篇关于如何获取组框中存在的对象(控件)的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆