Solved

Formating only a part of a String

Posted on 2004-10-14
7
140 Views
Last Modified: 2012-05-05
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
7 Comments
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12313181
I would use a RichTextBox
0
 

Author Comment

by:ucla11
ID: 12315348
how the RichTextBox control work exacty?
0
 
LVL 10

Expert Comment

by:123654789987
ID: 12316831
Why don't u use a normal textbox with MultiLine property set to "true"
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 19

Accepted Solution

by:
Desp earned 250 total points
ID: 12318154
RichTextBox1.Select(RichTextBox1.Text.IndexOf("1000"), 4)

RichTextBox1.SelectionFont = New Font("Verdana", 12, FontStyle.Bold)
RichTextBox1.SelectionColor = Color.Red
0
 
LVL 19

Expert Comment

by:Desp
ID: 12318165
you CANT do this with a normal TextBox
0
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12318825
The question is already answered man
0
 
LVL 19

Expert Comment

by:Desp
ID: 12319029
Question:
how the RichTextBox control work exacty?

Answer:
RichTextBox1.Select(RichTextBox1.Text.IndexOf("1000"), 4)
RichTextBox1.SelectionFont = New Font("Verdana", 12, FontStyle.Bold)
RichTextBox1.SelectionColor = Color.Red

----------------------------------------------------------
Comment:
Why don't u use a normal textbox with MultiLine property set to "true"

Argument:
you CANT do this with a normal TextBox
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

17 Experts available now in Live!

Get 1:1 Help Now