Exemplo n.º 1
0
        public void Select(int start, int length)
        {
            var tp = _rtb.Document.ContentStart;

            _rtb.Selection.Select(GetPoint(tp, start), GetPoint(tp, start + length));
            _rtb.ScrollToVerticalOffset(_rtb.Selection.Start.GetCharacterRect(LogicalDirection.Forward).Top);
            _rtb.Selection.ApplyPropertyValue(TextElement.BackgroundProperty, Brushes.Yellow);
            _oldsel = new TextRange(_rtb.Selection.Start, _rtb.Selection.End);
            _rtb.SelectionChanged += rtb_SelectionChanged;
        }