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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:16:46+00:00 2026-06-16T00:16:46+00:00

If this has been asked before, sorry. How can i set up different fonts

  • 0

If this has been asked before, sorry.

How can i set up different fonts in one RichTextBox using VB.NET? Because when i do this:

Dim String as String = "text" & vbCrLf & "more text"

Form.RichTextBox.Text = String
Form.RichTextBox.Select(String.IndexOf("Score: 5"), Len("Score: 5"))
Form.RichTextBox.SelectionFont = New Font(Presentatie.rtxtPresentatie.SelectionFont, FontStyle.Bold)

It will only make the “core: 5” part bold (tested this with selecting only, too, then it will only select the “core: 5” part).

Anyone help me? I need to get the answer very fast so please!

EDIT: Solved. Used this:

Form.RichTextBox.Select(String.IndexOf("Score: 5") - 1, Len("Score: 5"))

Thanks to codingbiz

  • 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-16T00:16:46+00:00Added an answer on June 16, 2026 at 12:16 am

    I didn’t post my comment as answer because I was worried of when IndexOf returns 0, then -1 would throw an exception. So here is the solution from microsoft

     Public Sub SelectMyString()
    
        ' Create a string to search for the word "fox".
        Dim searchString As String = "fox"
    
        ' Determine the starting location of the word "fox".
        Dim index As Integer = Form.RichTextBox.IndexOf(searchString)
    
        ' Determine if the word has been found and select it if it was. 
        If index != -1 Then
           'Select the string using the index and the length of the string.
           Form.RichTextBox.Select(index, searchString.Length)
        End If
     End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this has been asked before but I've tried searching and can't find
I'm sorry if this question has been asked before, but I can't seem to
Sorry if this has been asked before (though I can't really find a solution).
Sorry if this has been asked before, but I can't find a clear enough
Sorry if this has been asked before. I couldn't find a definitive answer. Can
Sorry if it has been asked before, I can't find any question about this
Sorry if this has been asked before, I can't seem to find anything. I'm
(I’m sorry if this has been asked before; the search feature seems to be
Sorry if this has been asked before, but I couldn't find a good example
Sorry if this has been asked before, but I'm wondering what the best memory

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.