我正在为WinRT编写一个简单的应用程序,我无法找到一种方法来自动滚动到我的代码中TextBox的底部.我正在将日志信息写入TextBox并希望它滚动以便最新的条目在框中可见,但似乎没有任何效果.以下是我尝试过的一些事情:
将TextBox放在ScrollViewer中:
this.txtLog.Text = this.txtLog.Text + line + "\r\n";
ScrollToVerticallOffset(scrollView.ScrollableHeight);
Run Code Online (Sandbox Code Playgroud)
选择TextBox中的最后一个数据:
this.txtLog.Select(this.txtLog.Text.Length, 0);
Run Code Online (Sandbox Code Playgroud)
但实际上我没有做任何事情导致显示的文本滚动,以便底部数据可见.
有没有人有任何想法?