GUI editbox can't evoke a pushbotton?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Salad Box
am 17 Mai 2019
Beantwortet: Walter Roberson
am 17 Mai 2019
Hi,
I'm working on a GUI design and I created a edit box and a pushbutton. Shown in the picture below.
![Untitled1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/220012/Untitled1.png)
What I would like to achieve is that when I type some words in the editbox, if the length of the string I type in is greater than 5, I would like to evoke the pushbotton on the right by doing to things - 1) The string for the pushbutton 'next' will appear on the pushbutton; and 2) the pushbutton will be enabled.
However, the code I worte under 'edit1_Callback' doesn't seem to evoke the pushbotton at all. Why?
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/220013/Untitled.png)
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 17 Mai 2019
Callback for uicontrol style edit do not get invoked until the user presses enter or the user moves focus elsewhere. If you need control per key then you need the key press callback. However when you use the key press callback then the String property is not updated until the circumstances under which the Callback would be invoked and the display is not updated if you change the String property, so you have to keep track of characters yourself including keeping track of user deletion characters.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Search Path finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!