none
Run time Paragraph issue with flow document. RRS feed

  • Вопрос

  • First I am attaching image to figure out the my problem.


    how to display paragraph with bold and normal font in my project. My code is

                

    Section terms = new Section();

    Paragraph acceptanceofTermsHeader = new Paragraph(new Run("Acceptance of Terms: By submitting a purchase order or accepting a price quotation of Power Plus LLC for the products")); acceptanceofTermsHeader.FontSize = 16; terms.Blocks.Add(acceptanceofTermsHeader);

    How to achieve this. I am using FlowDocument and displaying the section inside this.

    Please provide needful solution.

    Thanks.

    23 августа 2019 г. 14:46

Ответы

  • Is this a trick question?

    To paragraph, you add two runs, one bold and one normal. You don't have to add all of the text as one run. Add your properties to the run, not the entire Paragraph.

    Hope this helps!


    noorbakhsh حميد نوربخش

    Run myRun = new Run("Hello there") { FontWeight = FontWeights.Bold };
    acceptanceofTermsHeader.Inlines.Add(myRun);
    
    Or just add it as a Bold inline:
    
    acceptanceofTermsHeader.Inlines.Add(new Bold("Hello there"));

    • Изменено noorbakhsh 23 августа 2019 г. 20:42
    • Помечено в качестве ответа AnkitKumar2016 26 августа 2019 г. 7:23
    23 августа 2019 г. 20:06