【发布时间】:2013-08-15 10:43:30
【问题描述】:
我的 WPF 应用程序中目前有一个只读的文本框:
<TextBox x:Name="TextBox_CurrentDirectory" IsReadOnly="True"></TextBox>
并且文本在后面的代码中得到更新:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var app = Application.Current as App;
TextBox_CurrentDirectory.Text = app.ActiveDirectory;
//Show the end of the text here
}
有没有办法让我以编程方式显示文本的结尾?如果 TextBox 中的文本比 TextBox 长,它只显示开头并被截断。我希望能够显示文本的结尾。
我尝试过使用
TextBox_CurrentDirectory.CaretIndex = TextBox_CurrentDirectory.Text.Length;
但什么也没发生。
【问题讨论】:
标签: c# wpf xaml textbox readonly