我有一个文本框,当输入的键是“返回”时,它有 keydown 事件字母“a”被覆盖变成“b”,但不会变成“ab”。有谁知道这是什么原因?
private void barcodetexbox_KeyDown(object sender, KeyEventArgs e)
{
if (scannedString.Text != "" && e.Key==Key.Return)
{
//do something
}
}
在“MainWindow.xaml”中
<TextBox x:Name="scannedString" HorizontalAlignment="Left" Height="50"
Margin="468,164,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="450"
FontSize="24" Focusable="True" Padding="0,6,0,0"
KeyDown="barcodetexbox_KeyDown" />