Solved

Formating only a part of a String

Posted on 2004-10-14
7
141 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

14 Experts available now in Live!

Get 1:1 Help Now