How can I make the text that I enter into an edit text box update dynamically?

8 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Jun 2011
This enhancement has been incorporated in Release 2011a (R2011a). For previous product releases, read below for any possible workarounds:
This is expected behavior of the Edit Box UICONTROL in MATLAB.
You can try using the 'keypressfcn' to grab the keyboard input. The attached two files demonstrate the ability of real-time text update. As you enter text into the upper edit box, the text will be copied to the edit box beneath it as you enter.
1. Please download the following two files:
test_keypressfcn.m
test_keypressfcn.fig
2. Execute the program.
3. A GUI will appear. Enter text in the upper edit box displayed in the GUI.
4. Observe the text in the lower editbox is updated dynamically or in real-time as you enter test in the upper edit box.
Please note that this will work only for text that is continuously entered in the editbox. If you type in between words already entered in the editbox the gui will not perform as expected. You will need to implement logic similar to the one in this example to get the behavior that you desire.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!