예제 #1
0
 private static void OnAutoScroll(TextBoxBase textBox)
 {
     if (textBox != null)
     {
         textBox.ScrollToEnd();
     }
 }
예제 #2
0
        private static void AutoScroll(TextBoxBase control)
        {
            var scrollPosition = GetScrollVerticalAlignment(control);

            if (scrollPosition == VerticalAlignment.Bottom && control.IsVisible)
            {
                control.ScrollToEnd();
            }
        }
 /// <summary>
 /// writes the message to the box (if available)
 /// </summary>
 /// <param name="message">the message to output</param>
 public new void WriteMessage(string message)
 {
     base.WriteMessage(message);
     outputTextBox.Dispatcher.Invoke(new Action(() =>
     {
         outputTextBox.AppendText(message + "\n");
         outputTextBox.ScrollToEnd();
     })
                                     );
 }
예제 #4
0
        private void TextBox_TextChanged_ScrollToEnd(object sender, TextChangedEventArgs e)
        {
            //textBox_status.ScrollToEnd();
            TextBoxBase tb = sender as TextBoxBase;

            if (tb == null)
            {
                return;
            }
            tb.ScrollToEnd();
        }
예제 #5
0
파일: TextLogger.cs 프로젝트: Dr1N/Twitcher
        public void WriteLog(string message)
        {
            if (textElement == null)
            {
                return;
            }

            string time = DateTime.Now.ToString("HH:mm:ss");

            try
            {
                textElement.Dispatcher.Invoke(() => textElement.AppendText($"{time} - {message}" + Environment.NewLine));
                textElement.Dispatcher.Invoke(() => textElement.ScrollToEnd());
            }
            catch (OperationCanceledException ex)
            {
                Debug.WriteLine($"LOGGER: {ex.Message}");
            }
        }
예제 #6
0
 public static void AppendLine(this TextBoxBase box, string text)
 {
     box.AppendText(text + Environment.NewLine);
     box.ScrollToEnd();
 }