ValidateCaretPos() публичный Метод

If the caret position is outside the document text bounds it is set to the correct position by calling ValidateCaretPos.
public ValidateCaretPos ( ) : void
Результат void
Пример #1
0
 protected override void OnEnter(EventArgs e)
 {
     // SD2-1072 - Make sure the caret line is valid if anyone
     // has handlers for the Enter event.
     Caret.ValidateCaretPos();
     base.OnEnter(e);
 }
Пример #2
0
 void DocumentTextContentChanged(object sender, EventArgs e)
 {
     // after the text content is changed abruptly, we need to validate the
     // caret position - otherwise the caret position is invalid for a short amount
     // of time, which can break client code that expects that the caret position is always valid
     Caret.ValidateCaretPos();
 }
Пример #3
0
        void DocumentUpdateCommitted(object sender, EventArgs e)
        {
            if (motherTextEditorControl.IsInUpdate == false)
            {
                Caret.ValidateCaretPos();

                // AdjustScrollBarsOnCommittedUpdate
                if (!scrollToPosOnNextUpdate.IsEmpty)
                {
                    ScrollTo(scrollToPosOnNextUpdate.Y, scrollToPosOnNextUpdate.X);
                }
                if (adjustScrollBarsOnNextUpdate)
                {
                    AdjustScrollBarsClearCache();
                    AdjustScrollBars();
                }
            }
        }