Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
655 views
in Technique[技术] by (71.8m points)

openedge - 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.

question from:https://stackoverflow.com/questions/65626208/how-to-access-controls

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
ASSIGN TestField:READ-ONLY IN FRAME {&FRAME-NAME} = TRUE.

or

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...