简体   繁体   中英

(C#) Silverlight TextBox Scroll to Bottom

I want to get a Textbox to autoscroll to bottom whenever it gets updated with text, but it seems that there is no such method in Silverlight. In Windows Forms, I would do it this way:

textbox_txt.SelectionStart = textbox_txt.Text.Length;
textbox_txt.ScrollToCaret();

In Windows Presentation Foundation, I would do it this way:

textbox_txt.SelectionStart = textbox_txt.Text.Length;
textbox_txt.ScrollToEnd();

Now how the heck do I do this in Silverlight? there is no such scroll method anywhere.

ActualHeight contains the total height of the text. You can wrap text into the scroll view as described here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM