Home > Software engineering >  How to make bold any specific sentence of textfile data that start with <H> using c#?
How to make bold any specific sentence of textfile data that start with <H> using c#?

Time:05-18

File data like this.

<H> Terms of Use (Sample)

Blockquote

These Terms of Use (hereinafter referred to as "Terms") are the services provided by XYZ (hereinafter referred to as "Company") on this website (hereinafter referred to as "Services"). ) Establishes the terms of use. Registered users (hereinafter referred to as "users") are required to use this service in accordance with this agreement.

<H>Article 1 (Applicable)

Blockquote

This agreement shall apply to all relationships related to the use of this service between the user and our XYZ company.

Thank you

CodePudding user response:

To have different text Type in label, you can try spantext, code like:

  <Label FontSize="16" >
            <Label.FormattedText>
                <FormattedString>
                    <FormattedString.Spans>
                        <Span Text="Hello " x:Name="text1"/>
                        <Span Text="World " FontAttributes="Bold"  x:Name="text2"/>
                    </FormattedString.Spans>
                </FormattedString>
            </Label.FormattedText>
        </Label>

As for how to change the specific sentence, you can get the span text in code behind, and handle it there on Onappearing method.

  • Related