Skip to main content

Microsoft Silverlight

Answered Question How to write <br/> for silverlight RSS Feed

(0)

slen
slen

Member

Member

10 points

59 Posts

How to write <br/> for silverlight

 As title, I would like to go to next line between controls. Does anyone know how ...

 

Thanks

 

TomBeeby
TomBeeby

Participant

Participant

1151 points

188 Posts

Answered Question

Re: How to write <br/> for silverlight

Typically you arrange controls relative to one another by putting them inside a panel of a specific type.

StackPanel arranges vertically or horizontally; grid arranges in a grid pattern etc; wrappanel wraps

here are some samples of getting a newline in text

 

<StackPanel>
    <TextBlock Text="First Line" />
    <TextBlock Text="Scond Line" />
    <TextBlock>
        <Run Text="This is a line of text" />
        <LineBreak />
        <Run Text="This ia another line of text" />
    </TextBlock>
</StackPanel>

  

But if you are trying to arrange 2 controls vertically, use a StackPanel

slen
slen

Member

Member

10 points

59 Posts

Re: Re: How to write <br/> for silverlight

Actually, what I am trying to accomplish here is to have some gaps between 2 controls vertically.

It is good to know there is <LineBreak> to break text into 2 lines. 

TomBeeby
TomBeeby

Participant

Participant

1151 points

188 Posts

Re: Re: How to write <br/> for silverlight

You could use a StackPanel with orientation = vertical (the default)

Then specify an amount for Margin of the two objects.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities