Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8469751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:18:56+00:00 2026-06-10T16:18:56+00:00

Possible Duplicate: Can I have multiple colors in a single TextBlock in WPF? Is

  • 0

Possible Duplicate:
Can I have multiple colors in a single TextBlock in WPF?

Is it possible to style sections of a WPF TextBlock, such as a certain word to be bold, italic or underlined? Can you change all font properties? If so, what solution is the prettiest and most performance effective?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:18:58+00:00Added an answer on June 10, 2026 at 4:18 pm

    You can style runs individually within a TextBlock in XAML, or you can use the Inlines property in your .cs codebehind file. This blog post indicates that you can style at least font style, font weight, foreground color, and font size.

    XAML:

    <TextBlock>
         <Run Text="SomeText" FontWeight="Bold" FontStyle="Italic"/>
         <Run Text=" some more text" FontSize="12"/>
         <Run Text=" and more" Foreground="Blue"/>
    </TextBlock >
    

    And here’s an example showing adding a brush to the run from C# Corner:

    <Run.Foreground>
       <LinearGradientBrush>
          <GradientStop Color="Green" Offset="0.0" />
          <GradientStop Color="Purple" Offset="0.25" />
          <GradientStop Color="Orange" Offset="0.5" />
          <GradientStop Color="Blue" Offset="0.75" />
       </LinearGradientBrush>
    </Run.Foreground>
    

    The Inlines collection you can access programmatically is a collection of System.Windows.Documents.Run objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can you have multiple $(document).ready(function() sections? Is it OK to have multiple
Possible Duplicate: jQuery - is it bad to have multiple $(document).ready(function() {}); Can you
Possible Duplicate: Multiple forms on ASP.NET page i have a doubt. can we place
Possible Duplicate: Can Super deal with multiple inheritance? Python inheritance? I have a class
Possible Duplicate: Can I have multiple background images using CSS? Is it possible to
Possible Duplicate: ASP.NET MVC - Can i have multiple names for the same action?
Possible Duplicate: Can I have multiple background images using CSS? I am making a
Possible Duplicate: jQuery - is it bad to have multiple $(document).ready(function() {}); Can you
Possible Duplicate: Can I change the FormsAuthentication cookie name? I have multiple MVC3 sites
Possible Duplicate: Can I scroll a ScrollView programmatically in Android? I have a chat

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.