MATLAB: Give focus to an Edit Field

active objecteditfieldfocusMATLAB

In the app I'm making, I need to move the cursor to a textbox when I press a button such that it is ready for input. I tried placing
uicontrol(app.DistanceEditField)
in the callback for the button but it doesn't work because I’m using App Designer (MATLAB R2017a). Is there a similar way that would work in the App Designer?

Best Answer

This functionality with "uicontrol" is currently unavailable in App Designer. I have forwarded your feedback to our developers and they will consider adding support for this in a future release of MATLAB.