Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Getting Theme Colors (XP)

    When designing a userform, you can set the background color to a window's theme color like ButtonFace or Highlight. How can you do this at run time? I just want to toggle the background color of a label between ButtonFace & Highlight when you click on it. For now, I'll just use an RGB for a light grey & medium blue, but I'd rather use the Window's theme colors directly. TIA --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Getting Theme Colors (XP)

    You can use the SystemColorConstants for this, in your example vbButtonFace and vbHighlight.
    <code>
    With Me.Label1
    .BackStyle = fmBackStyleOpaque
    .BackColor = vbButtonFace
    End With
    </code>
    Search for SystemColorConstants in the Object Browser (F2) to see a list of available constants.

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Getting Theme Colors (XP)

    Wow, way too easy! Thanks!
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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