문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top