Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3793598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:48:00+00:00 2026-05-19T12:48:00+00:00

I am having hard time to match Special characters set in Silverlight. I only

  • 0

I am having hard time to match Special characters set in Silverlight. I only on the following:

To represent a LineBreak in Silverlight TextBlock:

use : > lineBreak <

But What do I use to represent a New Line or LineBreak In Silverlight TextBox??

Example : I want this one line mag : This is line one. This is line two

into this :

This is line one.
This is line two.

it seems this \r\n is not working. This is line one \r\n

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:48:01+00:00Added an answer on May 19, 2026 at 12:48 pm

    The bottom line at the top

    <TextBox Text="This is line one!&#13;This is line two!" />
    

    Linebreak Weirdness in the Silverlight TextBox

    If you are going to be initialising content of a TextBox with literal text in Xaml in a similiar way that you might a TextBlock then you need a reliable way to represent the line break character the Silverlight uses in Xaml.

    Silveright uses a CR character (0x0D – ASCII 13) to represent a linebreak which in C# you include in a string literal as \r. However Xaml isn’t C# so you can’t use \r in Xaml.

    Xaml is fundementally XML but with some Xaml parsing oddities. Just including a linebreak, as Derek has in his answer, directly in the Xaml will not work at runtime (although the designer displays it as expected). You might think that this because Xml uses the LF character (0x0A) as its linebreak character. However in code you can assign a string containing “\r” or “\n” to the Text property and the TextBox will show a new line. In fact you can assign the sequence “\r\n” and it will show a single new line (not two new lines).

    Ultimately you can use the Xml character code entity to represent a \r in Xaml "&#13;" which survives the Xaml parsing process for reason which I cannot actually explain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hehe I'm having hard time on choosing the question title. But let me explain
I'm having a hard time determining what characters must be escaped when using Perl's
I am having a hard time finding a regular expression that can match these
I'm having a hard time understanding why the following expression \\[B.+\\] and code returns
Sorry for the vague topic but I'm having a hard time explaining this. What
Just come across the following line of code and having a hard time finding
I'm having a hard time trying to figure a regex to match patterns of
I'm having hard time trying to figure out how to auto-save user data in
I am having hard time in understanding Wait() , Pulse() , PulseAll() . Will
I am having hard time getting hasErrors to work with indexed properties. For example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.