Azzera filtri
Azzera filtri

edit box keypressfcn on every keypress

3 visualizzazioni (ultimi 30 giorni)
Brian
Brian il 9 Apr 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

Risposte (1)

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

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by