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 8104669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:55:00+00:00 2026-06-05T23:55:00+00:00

In my application, i want user to select a font, from a list of

  • 0

In my application, i want user to select a font, from a list of fonts available in user’s system and set that font to richtextbox.
I tried ::

    System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
        foreach (FontFamily family in fonts.Families)
        {
           comboBox1.Items.Add(family.Name);
        }

and

    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        richTextBox1.Font = new Font(comboBox1.SelectedText, 14);
    }

but it changes the default behaviour of the text. For example: text includes headings in bold and italics. Setting the font with above code transforms the text in the regular form.
My question is, to possibly keep the behaviour of the text as before and not to change the complete text in regular form by keeping the bold text in bold and italics in italics.

  • 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-05T23:55:01+00:00Added an answer on June 5, 2026 at 11:55 pm

    SelectedText is for the highlighted part of the ComboBox text property. Probably not what you want:

    richTextBox1.Font = new Font(comboBox1.Text, 14);
    

    Also, if you just want the highlighted part of the RichTextBox to have the new font:

    richTextBox1.SelectionFont = new Font(comboBox1.Text, 14);
    

    If any part of the highlighted text has a mix of bold and italics and different sizes, etc, the RichTextBox does not preserve those properties very well. See How do I maintain RichText formatting (bold/italic/etc) when changing any one element?

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

Sidebar

Related Questions

In my Androïd application, I want to let the user select the font he
In my application I want to give the user ways of selecting text from
In my application I want to present a list of choices for a user
i want to make an application which includes dynamic screensaver. User can select multiple
I want the user to select which Activity the application should start on. I
I am currently developing an android application. I want the user to select an
I want the user to select a file from an iPhone and upload to
I have an application, in which the user will select an image from a
I have a MPMediaPickerController in an iPhone application that prompts a user to select
In my application I want the user to load an image as the canvas

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.