读书人

新手刚学PowerBuilder怎么遍历窗体中

发布时间: 2012-03-16 16:34:56 作者: rapoo

新手刚学PowerBuilder,如何遍历窗体中GroupBox控件中的其他控件
GroupBox中放了几个单选按钮,如何动态遍历出GroupBox中的单选按钮并获取其是否被选中的状态。

[解决办法]

C/C++ code
long iRadioButton lrbfor i = 1 to upperbound(this.control)    if this.control[i].typeof() = RadioButton! then //单选框        lrb = this.control[i]        if lrb.x >= gb_1.x and lrb.y >= gb_1.y and lrb.x <= gb_1.x + gb_1.width and lrb.y <= gb_1.y + gb_1.height then //在gb_1内            //lrb.checked  判断是否选择,然后做你想做的        end if    end ifnext
[解决办法]
this 指的是当前window, 如果以上代码是写在窗口的控件中的,需要将this改成parent

读书人网 >PB

热点推荐