Link to home
Start Free TrialLog in
Avatar of ucla11
ucla11

asked on

Formating only a part of a String

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.....
Avatar of eozz_2000
eozz_2000

I would use a RichTextBox
Avatar of ucla11

ASKER

how the RichTextBox control work exacty?
Why don't u use a normal textbox with MultiLine property set to "true"
ASKER CERTIFIED SOLUTION
Avatar of Fahad Mukhtar
Fahad Mukhtar
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you CANT do this with a normal TextBox
The question is already answered man
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