How to make a Text Area auto-scroll to bottom (created in app designer)

85 Ansichten (letzte 30 Tage)
I created a Text Area in app designer. It is populated with status messages as the app runs. After a while the area fills with lines of text, and the vertical scroll bar appears, but new messages are written in the invisible part of the area. The user has to scroll down "by hand". How can I make the Text Area autoscroll, so that each new message is visible?

Akzeptierte Antwort

Eric Sargent
Eric Sargent am 9 Dez. 2020
  1 Kommentar
Frank van Diggelen
Frank van Diggelen am 17 Jun. 2022
Bearbeitet: Frank van Diggelen am 17 Jun. 2022
Thank you. This is working well for me from in an app built in appdesigner, in R2022a:
scroll(app.MyTextArea, 'bottom') %autoscroll text area to bottom

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Chris Portal
Chris Portal am 5 Aug. 2017
If it's possible to use a listbox instead of a text area, you would be able to use the scroll function to programmatically scroll specific items into view:
https://www.mathworks.com/help/matlab/ref/scroll.html
  1 Kommentar
Marko Antila
Marko Antila am 14 Feb. 2019
Bearbeitet: Marko Antila am 14 Feb. 2019
Scroll function does not work properly with App Designer List Box, unfortunately:
  • in startFcn it hides the List Box (permanently)
  • in callbacks it does exactly nothing

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by