Availability Of Widget In A Frame

sacharya

New Member
Hi Team,

Is there a way to check for availability of any widget with the particular name in the frame using code.

Based on the availability of widget(Eg: Fill-In) need to perform some operation.

Thanks in advance for the suggestion.

Thanks,
Sachin
 
Does walking the widget tree help?:
Code:
DEFINE VARIABLE hWidget AS HANDLE NO-UNDO.

ASSIGN hWidget = FRAME fMain:FIRST-CHILD
       hWidget = hWidget:FIRST-CHILD.
DO WHILE VALID-HANDLE(hWidget):
   IF hWidget:TYPE = "FILL-IN" OR hWidget:TYPE = "TEXT" THEN
      MESSAGE hWidget:NAME SKIP hWidget:TYPE SKIP hWidget:DATA-TYPE SKIP hWidget:SCREEN-VALUE
              VIEW-AS ALERT-BOX INFO BUTTONS OK.
  ELSE
      MESSAGE hWidget:NAME SKIP hWidget:TYPE VIEW-AS ALERT-BOX INFO BUTTONS OK.
   ASSIGN hWidget = hWidget:NEXT-SIBLING.
END.
 
Back
Top