Back to Devexpress

RepositoryItem.KeyPress Event

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitem-35d5d28d.md

latest2.8 KB
Original Source

RepositoryItem.KeyPress Event

Fires when a character key is pressed while the editor has focus.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event KeyPressEventHandler KeyPress
vb
<DXCategory("Events")>
Public Event KeyPress As KeyPressEventHandler

Event Data

The KeyPress event's data class is KeyPressEventArgs. The following properties provide information specific to this event:

PropertyDescription
HandledGets or sets a value indicating whether the KeyPress event was handled.
KeyCharGets or sets the character corresponding to the key pressed.

Remarks

Unlike the RepositoryItem.KeyDown event, the KeyPress event is only raised in response to a character key being pressed. Note that pressing a character key raises both the RepositoryItem.KeyDown and KeyPress events.

Key events occur in the following order:

  1. RepositoryItem.KeyDown
  2. KeyPress
  3. RepositoryItem.KeyUp

The KeyPress event provides the Handled parameter. This can be set to true to prevent the character that has been pressed from being processed by the editor.

See Also

KeyDown

KeyUp

RepositoryItem Class

RepositoryItem Members

DevExpress.XtraEditors.Repository Namespace