Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAML - TextBox Linebreak [duplicate]

Tags:

wpf

textbox

xaml

Is there anyway in XAML only to have a linebreak in a TextBox?

I know I can set myTextBox.Text = "something\r\nsomething2" in Code, but I can't do this:

<TextBox x:Name="myTextBox">
    <TextBox.Text>
        Something
        <Linebreak/>
        Something2
    </TextBox.Text>
</TextBox>

or this

<TextBox x:Name="myTextBox" Text="something\r\nsomething2" />
like image 582
viggity Avatar asked Oct 21 '08 21:10

viggity


1 Answers

Try out...

<TextBox x:Name="myTextBox" Text="something1&#x0a;something2" />

Found here

like image 90
Dillie-O Avatar answered Oct 16 '22 01:10

Dillie-O