edit box keypressfcn on every keypress

3 次查看(过去 30 天)
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

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by