Dominique
Dominique

Reputation: 17551

How to access controls?

I have just created a window, containing a fill-in field (TestField) and a checkbox (chk_TestField):

DEFINE VARIABLE TestField AS INTEGER VIEW-AS FILL-IN.
DEFINE VARIABLE chk_TestField AS LOGICAL VIEW_AS TOGGLE-BOX.

It is very simple to change the value of the fill-in field, based on the checking of the checkbox, something like:

ON VALUE-CHANGED OF chk_TestField IN FRAME DEFAULT-FRAME
DO:
  TestField = 5.
END.

However, I'm interested in changing an attribute of the Fill-in field itself, not the integer it represents (I would like to make the fill-in field read-only), how to I do this?

I've tried:

ON VALUE-CHANGED OF chk_TestField IN FRAME DEFAULT-FRAME
DO:
  TestField.Read-Only = NOT(chk_TestField).
END.

This, obviously, does not work.

Upvotes: 0

Views: 42

Answers (1)

Mike Fechner
Mike Fechner

Reputation: 7192

ASSIGN TestField:READ-ONLY IN FRAME {&FRAME-NAME} = TRUE.

or

ASSIGN Table.TestField:READ-ONLY IN FRAME {&FRAME-NAME} = TRUE.

Upvotes: 2

Related Questions