Search code examples
c#.netwpfxamlflowdocument

How to make 2 inline elements with 0 margin?


I have FlowDocument

<FlowDocument>
    <Paragraph>
        <Run Text="foo" />
        <Run Text="bar" />
    </Paragraph>
</FlowDocument>

How to make 'foo' and 'bar' appear with no space in between?


Solution

  • Try this:

    <FlowDocument>
        <Paragraph>
            <Run Text="foo" /><Run Text="bar" />
        </Paragraph>
    </FlowDocument>
    

    I've noticed that if you keep the Run elements on the same line it prints it without the space.