Results 1 to 4 of 4

Thread: [RESOLVED] Label Forcolor - Color Only Numbers

  1. #1

    Thread Starter
    Addicted Member sinner0636's Avatar
    Join Date
    Sep 2009
    Posts
    233

    Resolved [RESOLVED] Label Forcolor - Color Only Numbers

    Hi

    Have a question coloring labels i have a label that i would only like to color the numeric values in the string red and the letters black or white is there a way to do this ?

    thanks

    Code:
    123 one two three

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Label Forcolor - Color Only Numbers

    No. You'll need to create a custom usercontrol or possibly use a RTF (richtext) control with no border and form backcolor to appear like a label. VB's label & textbox controls only support one color for text. Other options might be suggested...
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: Label Forcolor - Color Only Numbers

    Joacim Andersson has created a HyperLabel usercontrol that can do that and more.


    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Label Forcolor - Color Only Numbers

    A less full-featured alternative: RicherLabel UserControl.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width