1 private void TextBoxScrollToEnd(TextBox textBox){ 2 var grid = (Grid)VisualTreeHelper.GetChild(textBox, 0); 3 for (var i = 0; i <= VisualTreeHelper.GetChildrenCount(grid) - 1; i++) 4 { 5 object obj = VisualTreeHelper.GetChild(grid, i); 6 if (!(obj is ScrollViewer)) continue; 7 ((ScrollViewer)obj).ChangeView(0.0f, ((ScrollViewer)obj).ExtentHeight, 1.0f); 8 break; 9 } 10 } 11 }