WPF Single Line TextBox

I am using WPF.
I am trying to create a separate TextBox line, not a multi-line one.
What am I trying -

<StackPanel Orientation="Horizontal"> <TextBox Margin="5" VerticalAlignment="Center" Text="Single line" /> </StackPanel> 


But when I tried to enter text, the TextBox is multi-line, not single-line - How can I fix this? Thanks.

+6
source share
1 answer

By default, the text box is single. Perhaps you have defined some style for the text box?

Try setting TextWrapping = "NoWrap" and AcceptsReturn = "False" for your TextBox

+6
source

All Articles