필터 지우기
필터 지우기

edit box keypressfcn on every keypress

조회 수: 3 (최근 30일)
Brian
Brian 2012년 4월 9일
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