Beispiel #1
0
 private void rtBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == (Keys)40)
     {
         SuggestionBox.Focus();
         SuggestionBox.SelectedIndex = 0;
     }
 }
Beispiel #2
0
 private void rtBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Down)
     {
         SetToListBoxElement();
         SuggestionBox.Focus();
     }
 }
        private void SuggestionBoxOnTextChanged(object sender, TextChangedEventArgs e)
        {
            var input = SuggestionBox.Text;

            if (input.Length > _currentInput.Length && input != _currentSuggestion)
            {
                _currentSuggestion = SuggestionValues.FirstOrDefault(x => x.StartsWith(input));
                if (_currentSuggestion != null)
                {
                    _currentText     = _currentSuggestion;
                    _selectionStart  = input.Length;
                    _selectionLength = _currentSuggestion.Length - input.Length;

                    SuggestionBox.Text = _currentText;
                    SuggestionBox.Select(_selectionStart, _selectionLength);
                }
            }
            _currentInput = input;
        }
Beispiel #4
0
 // This is the method that it is called to unsubscribe a user and it's method for reading promotions ( To no longer get promotions )
 public void UnsubscribeForPromotions(PromotionSender subscriber, string reason)
 {
     Console.WriteLine("A person unsubscribed!");
     PromotionUserbase -= subscriber;
     SuggestionBox.Add(reason);
 }
Beispiel #5
0
 void SetToListBoxElement()
 {
     SuggestionBox.Focus();
     SuggestionBox.SelectedIndex = 0;
 }