Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Formatting only a part of a strings Font Bold

Posted on 2004-10-14
4
Medium Priority
?
428 Views
Last Modified: 2013-12-03
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
  • 3
4 Comments
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12313177
I would use a RichTextBox
0
 
LVL 4

Accepted Solution

by:
eozz_2000 earned 1000 total points
ID: 12313326
For example:

        Me.rttTextBox.Text = "This is my rich text box" & vbCrLf
        Me.rttTextBox.Text &= "1000" & vbCrLf
        Me.rttTextBox.Text &= "After the number"

        Me.rttTextBox.SelectionStart = Me.rttTextBox.Text.IndexOfAny("1000")
        Me.rttTextBox.SelectionLength = CStr("1000").Length
        Me.rttTextBox.SelectionFont = New Font(Me.rttTextBox.Font.Name, Me.rttTextBox.Font.Size, FontStyle.Bold)

You must select the number in your richTextBox control and then aply it a bold font.
0
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12315828
Well... where are you?
0
 

Author Comment

by:ucla11
ID: 12316043
Sorry I quess I asked the same question twice in the same category I accepted your anwser in the other post as well....Sorry
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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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