Info
This question is closed. Reopen it to edit or answer.
about GUI design!
2 views (last 30 days)
Show older comments
i have 3 edit text in gui, and i should fill 2 of them, without considering te order of them.let me clear up, consider 3 edit text: a,b&c, so i want to fill a&b and result must shown in c, or i fill c & b and result shown in a! and so on...the question is, how should i do this?! and how should i switch between them?!
2 Comments
Geoff Hayes
on 5 Jul 2018
hadi - I suppose you could have edit callbacks for each of your edit text controls. So once you enter some data in a, then its callback would fire and you would check to see what is in b which would be used to populate c. Likewise, editing c would result in perhaps a or b being updated (I'm not entirely clear on what rules you would use to update either a or b).
Adam
on 5 Jul 2018
You could also direct all your edit boxes to the same callback, which would check if any two of the boxes are non-empty and, if so, do whatever needs to be done with the inputs from the other two and put it in the 3rd editbox, whichever that is.
If you create an array of handles to your 3 edit boxes you can do it with indexing a little more neatly than using too many if-else statements.
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!