Solved

Formatting only a part of a strings Font Bold

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now