开发者

WPF : spacing between two <span> without space character

开发者 https://www.devze.com 2023-03-25 18:00 出处:网络
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:

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 sp开发者_如何学CanSubTitle = 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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消