Reputation:
I'm using WPF.
I try to create single line TextBox not multi line.
What i'm trying is
<StackPanel Orientation="Horizontal">
<TextBox Margin="5" VerticalAlignment="Center" Text="Single line" />
</StackPanel>
But when i tried to enter a text, the TextBox is multiline and not single line
How can i fix it?
Thanks.
Upvotes: 18
Views: 14256
Reputation: 552
Per default the Textbox is singleline. Maybe you have defined some Style for Textbox?
Try to set TextWrapping="NoWrap" and AcceptsReturn="False" for your TextBox
Upvotes: 23