Solved

Formating only a part of a String

Posted on 2004-10-14
7
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Telerik RadEditor Control Save 8 40
Broken .resx file generating errors 18 44
Check only one toolstripmenu item 12 63
Javascript function 3 22
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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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