Effacer les filtres
Effacer les filtres

edit box keypressfcn on every keypress

3 vues (au cours des 30 derniers jours)
Brian
Brian le 9 Avr 2012
Hi,
Got a pretty basic question, but just can't figure out how to solve my problem.
I'm desigining a simple GUI, with an edit text box and a list box. I want the list box to update its contents every time a character is entered into the edit box.
The problem is that the edit box's keypressfcn only executes once when a key is pressed, and won't execute again until the edit box loses focus, regains it and another character is entered. In other words, when entering two characters consecutively, the keypressfcn is run when the first character is entered, but not when the second character is input.
The only contents of the edit box's keypressfcn is a call to 'set' to change the list's 'String' property.
How do I get the keypress function to run every time a character is entered, without losing focus on the edit box so the user can keep typing?
Thanks, B

Réponses (1)

Daniel Shub
Daniel Shub le 9 Avr 2012
You could create a static text box and use the figure keypressfcn to update the info in the static text box.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by