I have a richtextbox and when is full I want automatically scroll to the bottom, It is possible? Do this with xaml?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
By using ScrollViewer.ScrollChanged
routed event, and writing some code (for example, richTextBox1.ScrollToEnd()
), you may be able to do what you want.
回答2:
RichTextBox
has a ScrollToEnd
method that could be called in the Codebehind. I don't know a way to do this in XAML only.
回答3:
Assuming your RichTextBox
is named Output
, attach this method to its TextChanged
event:
void Output_TextChanged(object sender, TextChangedEventArgs e)
{
Output.ScrollToEnd();
}