Results 1 to 3 of 3

Thread: Title Bar color?

  1. #1

    Thread Starter
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535
    Is it possible to change the color of the title bar of a form to something shady other than solid blue?


    Kinjal

  2. #2

  3. #3
    Guest
    Incase you get lazy and not look, like I almost did, here is the code:

    Code:
    Private Declare Function SetSysColors Lib "user32" _
    (ByVal nChanges As Long, lpSysColor As _
    Long, lpColorValues As Long) As Long 
         
    Private Const COLOR_SCROLLBAR = 0 'The Scrollbar colour
    Private Const COLOR_BACKGROUND = 1 'Colour of the background with no wallpaper
    Private Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window
    Private Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window
    Private Const COLOR_MENU = 4 'Menu
    Private Const COLOR_WINDOW = 5 'Windows background
    Private Const COLOR_WINDOWFRAME = 6 'Window frame
    Private Const COLOR_MENUTEXT = 7 'Window Text
    Private Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95)
    Private Const COLOR_CAPTIONTEXT = 9 'Text in window caption
    Private Const COLOR_ACTIVEBORDER = 10 'Border of active window
    Private Const COLOR_INACTIVEBORDER = 11 'Border of inactive window
    Private Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop
    Private Const COLOR_HIGHLIGHT = 13 'Selected item background
    Private Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item
    Private Const COLOR_BTNFACE = 15 'Button
    Private Const COLOR_BTNSHADOW = 16 '3D shading of button
    Private Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering is used.
    Private Const COLOR_BTNTEXT = 18 'Button text
    Private Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window
    Private Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button
    
    Public Sub SetTitleColour(lngColour As Long)
      ' Set the system colour for the title bar
      SetSysColors(1, COLOR_ACTIVECAPTION, lngColour)
    End Sub
    
    Private Sub cmdSetColour_Click()
      SetTitleColor RGB(255,0,0)
    End Sub

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