Exemplo n.º 1
0
 /// <summary>
 /// Fires the <i>KeyPress</i> event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnKeyPress(DXKeyboardEventArgs e)
 {
     if (this.keyPress != null)
     {
         this.keyPress(this, e);
     }
 }
Exemplo n.º 2
0
        void KeyboardActionPerformed(object sender, DXKeyboardEventArgs e)
        {
            if (!this.focused)
            {
                return;
            }
            switch (e.KeyboardAction)
            {
            case KeyboardAction.KeyHeld:
                break;

            case KeyboardAction.KeyPress:
                OnKeyPress(e);
                break;

            case KeyboardAction.KeyUp:
                break;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles a key being held down while the <see cref="DXListBox"/> has focus.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnKeyPress(DXKeyboardEventArgs e)
        {
            int index = 0;

            if (this.SelectedItem != null)
            {
                index = Items.IndexOf(this.SelectedItem);
            }

            if (e.KeyboardState[Key.UpArrow] && index > 0)
            {
                index--;
                this.SelectedItem = this.Items[index];
                OnSelectedIndexChanged();
            }
            else if (e.KeyboardState[Key.DownArrow] && index < (this.Items.Count - 1))
            {
                index++;
                this.SelectedItem = this.Items[index];
                OnSelectedIndexChanged();
            }

            base.OnKeyPress(e);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Handles a key being pressed while the <see cref="DXTextBox"/> has focus.
 /// </summary>
 /// <param name="e"></param>
 protected override void OnKeyPress(DXKeyboardEventArgs e)
 {
     this.Text += e.Key.ToString();
     base.OnKeyPress(e);
 }