敬业的IT人 >> 编程开发 >> VB >> 快速找到选中的OptionButton

快速找到选中的OptionButton

敬业的IT人 互联网 佚名 2008-1-3 17:07:02

OptionButton控件经常是作为控件数组存在的,要快速找到其中的哪一个被选中,可以使用下面的代码:

'假设控件数组包含3个OptionButton控件

intSelected=Option(0).Value*0-Option(1).Value*1-Option(2).Value*2

注意,因为第一个操作数总是0,所以上述代码可以精简如下:

intSelected=-Option(1).Value-Option(2).Value*2

->

粤ICP备06119539号
Copyright CiscoSky.Org,Some Rights Reserved.
Email:me1228#tom.com