Results 1 to 4 of 4

Thread: Hex color code

  1. #1
    Guest

    Post

    Can you use Hex color code in VB

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658

    Thumbs up Give this a whirl

    Yep, you can indeedy.

    Just use &H?, where ? is the hex digit.

    Code:
    Me.BackColor = &HF
    Iain, thats with an i by the way!

  3. #3
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535

    Lightbulb

    I think RGB() is much easier method to secify color code


    Kinjal

  4. #4
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290
    I use the code from the properties window - select your color (or custom color), copy the code, and declare a constant of the color name equal to the color code.

    Then, if you want something to be LightYellow, just say CommandButton1.backcolor=LightYellow.

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