Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Formating only a part of a String

Posted on 2004-10-14
7
Medium Priority
?
149 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Accepted Solution

by:
Fahad Mukhtar earned 750 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:Fahad Mukhtar
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:Fahad Mukhtar
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

782 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