Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
Anthony Mittas
Anthony Mittas el 12 de Jul. de 2011
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?"

Respuestas (1)

Paulo Silva
Paulo Silva el 12 de Jul. de 2011
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.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by