I have a textbox which has keydown event when entered key is "return" I have a barcode reader who read text into it but it is not writing more than one key i.e. only one letter is written lets say "a" and if i write second letter "a" is overwritten to become "b" but does not become "ab". Does anyone know what is cause of this ?
private void barcodetexbox_KeyDown(object sender, KeyEventArgs e) { if (scannedString.Text != "" && e.Key==Key.Return) { //do something } } and in "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" />
do somethingdo?barcodetextbox.Text = e.Key;instead ofbarcodetextbox.Text += e.Key;