Jason Evans
Jason Evans

Reputation: 29186

How to add a newline to PromptAttribute text?

I'm using a method to return a PromptAttribute for a .SetPrompt() call in my formflow dialog.

private static PromptAttribute CreateHappyWithAnswersPrompt()
{
    StringBuilder sb = new StringBuilder(100);

    sb.Append("Are you happy with your answers? \n\n ");
    sb.Append("{&RegistrationNumber}: {RegistrationNumber} {||}");

    return new PromptAttribute(sb.ToString())
    {
        ChoiceStyle = ChoiceStyleOptions.Buttons,
        FieldCase = CaseNormalization.InitialUpper
    };
}

The issue I'm encountering is that the newline \n\n is not applied...

enter image description here

I've tried various combinations of \n, \r, \n\r etc and nothing works.

Is adding a newline for a prompt actually doable?

EDIT:

Using sb.Append("Are you happy with your answers? " + Environment.NewLine); results in the following...

enter image description here

Not quite what I'm looking for, as I'd prefer the newline to appear in the hero card.

Upvotes: 0

Views: 99

Answers (1)

KYL3R
KYL3R

Reputation: 4073

Try: <br/>

Otherwise try "..{Environment.NewLine}" where .. are two whitespaces.

Upvotes: 3

Related Questions