How can I get a linebreak in TextBox in WP7? I'm developing social-based app(like facebook) and if I set AcceptReturn=true, it gives me a visual(ui) linebreak, but when I send this text to the server I can see that there is no linebreak. Please help me with this problem. I've tried
void whatsend_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) {
if (e.Key == Key.Enter) {
whatsend.Text +="\r";//or /n,
}
}
but with no success.
Windows uses \r\n
for line breaks, not \r
, but that's irrelevant; use Environment.NewLine
instead.
Also, per the docs:
true if the ENTER key creates a new line of text in a multiline version of the control; false if the ENTER key activates the default button for the form. The default is false.
Did you set MultiLine
to true
?
EDIT: Ahhh, WP7... here is an article I found which attempts to create a multi-line textbox in WP7.
Environment.NewLine if its the same as normal development.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With