Determine the number of Visible Objects in a window Powerbuilder

1.9k views Asked by At

I am new to PowerBuilder,

I put 10 objects in a window, and visibility of 9 object is false by default.

when I click a text/data on a 'ddlb' some object may appear or get visible. example. 2 textboxes , 2 buttons and 1 'ddlb' must get visible

my questions is, is there a way to determine the number of object control in a window that is being visible?

hope someone could help.. thanks.

1

There are 1 answers

1
Bruce Armstrong On

You could loop through the window control array and check the visible status of each control (literally windowobject) there:

int li_count, li_index, li_visiblecount = 0

li_count = UpperBound(this.control)
FOR li_index = 1 TO li_count
  IF this.control[li_index].visible THEN
    li_visiblecount ++
  END IF
NEXT

However, what you should really consider doing if you are using PowerBuilder is using a DataWindow with controls on it rather than separate windows controls.