Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
494 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 Reply

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...