Solved

Formatting only a part of a strings Font Bold

Posted on 2004-10-14
4
417 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

632 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