Solved

Formatting only a part of a strings Font Bold

Posted on 2004-10-14
4
410 Views
Last Modified: 2013-12-03
I have text that is added to a textbox and I want to BOLD only a certain section of the string.
Example:
(1,000) .... One Thousand

I just want the 1,000  font bolded

the code is as followes:

Text3.text = Text3.text & "(" & Label3.Caption & ")" & Text2.text VbCrLf

The Label3.Caption is the Number (1,000) the Text2.text is that number convert to a text form and as the user enters more numbersto be converted it adds them to to the next line of the textbox.

Should I use a Listbox instead of a text box?

I would like to make the Number (Label3.Caption) Font Bold so that it stands out.

Thanks.....
0
Comment
Question by:ucla11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12313177
I would use a RichTextBox
0
 
LVL 4

Accepted Solution

by:
eozz_2000 earned 250 total points
ID: 12313326
For example:

        Me.rttTextBox.Text = "This is my rich text box" & vbCrLf
        Me.rttTextBox.Text &= "1000" & vbCrLf
        Me.rttTextBox.Text &= "After the number"

        Me.rttTextBox.SelectionStart = Me.rttTextBox.Text.IndexOfAny("1000")
        Me.rttTextBox.SelectionLength = CStr("1000").Length
        Me.rttTextBox.SelectionFont = New Font(Me.rttTextBox.Font.Name, Me.rttTextBox.Font.Size, FontStyle.Bold)

You must select the number in your richTextBox control and then aply it a bold font.
0
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12315828
Well... where are you?
0
 

Author Comment

by:ucla11
ID: 12316043
Sorry I quess I asked the same question twice in the same category I accepted your anwser in the other post as well....Sorry
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question