필터 지우기
필터 지우기

Wait to enable an "OK" button unitl empty text boxes are filled

조회 수: 3 (최근 30일)
Anthony Mittas
Anthony Mittas 2011년 7월 12일
I enable a panel in a GUI that has several editable text boxes, an OK button, and a CANCEL button. I want to disable the OK button if one or all of the text boxes are empty, and enable it when all the text boxes are not empty. The CANCEL button is always enabled. How would I write code to say, "Wait until the OK or CANCEL buttons are pressed before resuming the GUI code, while keeping OK button disabled if one or all of the text boxes are empty?"

답변 (1개)

Paulo Silva
Paulo Silva 2011년 7월 12일
You don't say if you are using GUIDE so here are just a few tips, start the GUI with the editboxes all empty and the button disabled (if you want to have something on them by default enable the button), on every one of those editboxes callbacks check if all the boxes have something in them, if true enable the button.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by