Question

I have a Windows Forms application containing a TextBox. After I focus on the TextBox, I use a USB barcode scanner to read out a barcode string which always starts with a Line Feed (LF) character. The string that I retrieve later from the TextBox via the Text property does not include the LF character. I tried to capture the KeyUp event but it did not help either, the LF character seems to be ignored. How can I detect the Line Feed character?

Was it helpful?

Solution

I think that you need to set the MultiLine property of the text box to True
Using a textbox with its default value for Multiline (false) strips away the newline chars

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top