Either KeyDown or KeyUp.
TextBox tb = new TextBox();
tb.KeyDown += new KeyEventHandler(tb_KeyDown);
static void tb_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
//enter key is down
}
}
More Related Contents:
- Watermark / hint / placeholder text in TextBox?
- How do I get a TextBox to only accept numeric input in WPF?
- Add n rectangles to canvas with MVVM in WPF
- Set focus on TextBox in WPF from view model
- Implementing a log viewer with WPF
- Bind TextBox on Enter-key press
- Change color and font for some part of text in WPF C#
- Open file dialog and select a file using WPF controls and C#
- Set focus on textbox in WPF
- Trace listener to write to a text box (WPF application)
- Paste Event in a WPF TextBox
- Setting the Style property of a WPF Label in code?
- How do you do transition effects using the Frame control in WPF?
- Create WPF TextBox that accepts only numbers [duplicate]
- How to follow the end of a text in a TextBox with no NoWrap?
- Making specific Text Boldefaced in a TextBox
- How can I programmatically generate keypress events in C#?
- Loading XAML at runtime?
- The calling thread cannot access this object because a different thread owns it [duplicate]
- Embed Unity3D app inside WPF application
- ComboBox- SelectionChanged event has old value, not new value
- Software rendering mode – WPF
- Binding to static class property [duplicate]
- ItemsControl with horizontal orientation
- How to run something in the STA thread?
- Mvvm model ViewModel
- Terrible performance of custom-drawn control
- MyUserControl cannot be the root of a XAML file because it was defined using XAML [duplicate]
- How to fetch string from resource to assign in WPF Resource section in xaml
- Get the item doubleclick event of listview