protected override void OnFocusGained() { base.OnFocusGained(); _cursorPosition = this.Text.Length; EnsureCursorVisible(); }