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

  • Home
  • SEARCH
  • 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 7733995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:08:24+00:00 2026-06-01T07:08:24+00:00

My text is in a richtextbox: <Parag1 Level=One> First text of parag1. Second text

  • 0

My text is in a richtextbox:

<Parag1 Level="One">
First text of parag1. Second text of parag1.
</Parag1>
<Parag2 Level="Two">
First text of parag2. Second text of parag2.
</Parag2>
<Parag3 Level="Footer">
First text of parag3. Second text of parag3.
</Parag3>
<Parag4 Level="Three">
First text of parag4. Second text of parag4.
</Parag4>

I want change color font & text color of text :

1- For tags -> font name = Tahoma , size= 10,color=red

Example : <Parag1 Level="One"> Or </Parag1>

2- For Text between tags that tag’s level is not Footer -> font name = Arial , size= 12,color=black

Example : First text of parag1. Second text of parag1. Or First text of parag4. Second text of parag4.

3- For Text between tags that tag’s level is Footer -> font name = Microsoft Sans Serif, size= 8,color=blue

Example : First text of parag3. Second text of parag3.

How can I do it in c# ?(Changes font of all text at once!)

  • 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-01T07:08:26+00:00Added an answer on June 1, 2026 at 7:08 am

    You would need to select parts of text and use SelectionColorand SelectionFontproperties.
    Everything is explained here.

    Hope this helps

    Now for your other question, if you mean how to change the font and color of the text inserted while the program is running, try this.

             private void someTextBox_KeyPress(object sender, KeyPressEventArgs e)
             {
               this.someTextBox.SelectionColor = Color.Blue; 
               // Same goes for font and other properties
             }
    

    I don’t have time to test it so I don’t know how it will act with the other colors you previously set.

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

Sidebar

Related Questions

When I first run my program and type some text in the richtextbox, if
I want to open text files and load them into a RichTextBox. This has
I want to add some text in a WPF RichTextBox at runtime in a
So I want to style richtextbox text from code, but I don't know how.
How can you add text to a RichTextBox control and change the font style
Is it possible to change the position of text in a richtextbox? and how?
After getting the text in the RichTextBox I want to clear the text. How
I need to get the text in a RichTextBox while in another thread. I
I need to retrieve the character position of the selected text in a RichTextBox.
Editing a RichTextBox control's text (more specifically, modifying selection font/color) programmatically seems to be

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.