Wait to enable an "OK" button unitl empty text boxes are filled
1 回表示 (過去 30 日間)
古いコメントを表示
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?"
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!