Colour Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Does anyone know what the rgb of the vbbuttonface is please?.
TIA
Charles
 
Hi Charles,

It's a system colour, and system dependent (obviously!). You can return
these with the GetSysColor API. Normally the index's are fed as constants in
the range 0 to 20+ (a few gaps in the 20's depending on window's version).
However to save looking them up -

Declare Function GetSysColor Lib "user32" _
(ByVal nIndex As Long) As Long

Sub test()
Dim c As Long, n As Long
n = 2 ^ 31 + vbButtonFace ' 15
c = GetSysColor(n)

With ActiveSheet.Shapes.AddShape(1, 10, 10, 100, 100)
.Fill.ForeColor.RGB = c
End With

End Sub

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top