Missing line break

Peter_1985 2,686 Reputation points
2021-10-08T09:41:51.99+00:00

Hi,
I expect to have two lines produced by the following. But there is still no line break between the two parts.

            RunProperties runProperties3 = run.AppendChild(new RunProperties(new FontSize { Val = new StringValue("24") }));
            run.AppendChild(new Text(txt));
            RunProperties runProperties4 = run.AppendChild(new RunProperties(new FontSize { Val = new StringValue("16") }));
            run.AppendChild(new Text("\rPeter Wong"));
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,976 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,166 questions
0 comments No comments
{count} votes

Accepted answer
  1. P a u l 10,736 Reputation points
    2021-10-08T10:48:47.533+00:00

    If you remove that \r and add this above your last AppendChild call it should add one:

    run.AppendChild(new Break());
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.