mjk6026
mjk6026

Reputation: 1484

WPF : spacing between two <span> without space character

i'm build some contents into flowdocument in programming way, not xaml.

i need a way to spacing between two spans, no use space character trick like following code:

Run spanTitle = new Run(paraTitle);
myTitle.Inlines.Add(spanTitle);

//" " + paraSubtitle to spacing spanTitle and spanSubTitle.
Run spanSubTitle = new Run(" " + paraSubtitle);
myTitle.Inlines.Add(spanSubTitle);

i can't found any property in Span class, like a Margin, Padding, etc.

how can i control a space of two spans in programming way?

Upvotes: 2

Views: 2230

Answers (2)

Emond
Emond

Reputation: 50672

The proper spacing between two Runs in a Span IS a space because it will fit the font.

If you want a Margin or Padding, the two Runs should not be in the same Span.

Upvotes: 2

Michael Christensen
Michael Christensen

Reputation: 1786

You need to use a block element to have padding or margin.

Upvotes: 0

Related Questions