当前位置: 代码迷 >> PB >> 新手刚学PowerBuilder,怎么遍历窗体中GroupBox控件中的其他控件
  详细解决方案

新手刚学PowerBuilder,怎么遍历窗体中GroupBox控件中的其他控件

热度:85   发布时间:2016-04-29 08:43:08.0
新手刚学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
  相关解决方案