Results 1 to 6 of 6

Thread: Force Colours?

  1. #1

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252

    Question Force Colours?

    1. Is there a possibility to change the Backcolor of a toolbar
    even though it's not provided as a property of it?
    2. Is it possible to change the backcolor of a ComboBox dropdown
    arrow?

    -I've seen code about how to change the forecolour of CommandButtons, so I thought this could be somehow managable as well.

    It'd be awesome if someone of you guys could tell me about that.

    Tank You!

  2. #2
    New Member
    Join Date
    Jun 2001
    Location
    United Kingdom
    Posts
    2

    Toolbar backcolor

    Did you find out how to force the background color of the toolbar. We have the same problem, we are using skins in our application and want to make the toolbar use the same backcolor as the skin.

  3. #3

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    no, unfortunately not
    But maybe someone else knows. I think it must be possible by getting the RECT and then overdraw the area.

  4. #4

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    I tried the following:

    module:

    Public hdcColor As Long, hdcScreen As Long
    Public Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
    Public Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
    Public Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long

    form:

    Private Sub Command1_Click()
    hdcScreen = GetDC(Toolbar1.hWnd)
    hdcColor = CreateCompatibleDC(hdcScreen)
    SetBkColor hdcColor, vbBlack
    End Sub


    this should set for example the backcolor of the Toolbar to black but it doesn't work.

  5. #5
    New Member
    Join Date
    Jun 2001
    Location
    United Kingdom
    Posts
    2

    Smile We have a workaround

    We havent found a direct solution to the background color problem, but we have a workaround. Download this free toolbar OCX from http://freevbcode.com/ShowCode.Asp?ID=344 you can change the background color in this one.

    Hope it helps.

  6. #6

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    that's great, nice one!

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