How to change color in the middle of a label's caption?

I've tried a few methods none of which seem to have worked. I'm thinking it's has something to do with the forecolor property but I don't know how to change it in the middle of a caption.
lblBadID.Caption = "Bad IDs: " & BadIds%

I'd like the "Bad IDs:" to be in black and the badids% to be in red (ForeColor = &H000000FF&)

Thanks
JohnDoeSrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

g_johnsonCommented:
I don't think you can do this with a standard VB label.  Personally, I would use two labels without borders with different forecolors for each and autosized so that they fit together properly ...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
danaseamanCommented:
Try this Formatted Label UserControl from PSC. It uses HTML like tags to display different Font effects including color.
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=34507&lngWId=1
0
ArkCommented:
You can use PictureBox:
Private Sub Command1_Click()
   Dim BadIDs As Integer
   BadIDs = 10
   Picture1.Cls
   Picture1.ForeColor = vbBlack
   Picture1.Print "Bad IDs: ";
   Picture1.ForeColor = vbRed
   Picture1.Print BadIDs
End Sub
0
HTorresCommented:
yes a couple of labels with autosize
label2.left = label1.left + label1.width

why you need a label? you need response to events?
you can print direct to the form... what ever you want.

also you can use a rich text box (colors, font sizes, etc.. ) with the "enabled" property disabled or
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
    KeyAscii = 0
End Sub
wich will render useless everything you type, with out loosing event availability

hope this helps



0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.