Je cherche à changer la couleur de la barre d'un Userform qui apparait en bleu dégradé par défaut.
il me semble que cela dépend du paramétrage de windows ... la fenêtre aura la couleur définie dans les paramètres visuels de windows.
GAB.
Modeste
Bonjour, en effet ces propriétes sont des propriétés windows
on peut depuis Excel intervenir via VBA sur ces propriétés, il faudra toutefois etre prudent dans la modification des parametres !!!!!
dans un module : 'd'après KPD-Team 1998 'URL: http://www.allapi.net/ Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
Const COLOR_SCROLLBAR = 0 'The Scrollbar colour Const COLOR_BACKGROUND = 1 'Colour of the background with no wallpaper Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window Const COLOR_MENU = 4 'Menu Const COLOR_WINDOW = 5 'Windows background Const COLOR_WINDOWFRAME = 6 'Window frame Const COLOR_MENUTEXT = 7 'Window Text Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95) Const COLOR_CAPTIONTEXT = 9 'Text in window caption Const COLOR_ACTIVEBORDER = 10 'Border of active window Const COLOR_INACTIVEBORDER = 11 'Border of inactive window Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop Const COLOR_HIGHLIGHT = 13 'Selected item background Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item Const COLOR_BTNFACE = 15 'Button Const COLOR_BTNSHADOW = 16 '3D shading of button Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering is used. Const COLOR_BTNTEXT = 18 'Button text Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active window color Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd inactive window color
Sub ChangeActiveCaption()'---- change la couleur de la barre de titre active NomObjet$ = "COLOR_ACTIVECAPTION" ObjetSystem& = 2 '----- voir ci-dessus liste des constantes Oldcol& = GetSysColor(ObjetSystem&) NewCol& = SetSysColors(1, ObjetSystem&, RGB(255, 0, 0)) reponse = MsgBox("La couleur de l'objet systeme " & NomObjet$ & " était " & Str$(Oldcol&) _ & Chr(10) & " il est maintenant " & Str$(GetSysColor (ObjetSystem&)), vbOKCancel + vbDefaultButton2)
If reponse = vbCancel Then t& = SetSysColors(1, ObjetSystem&, Oldcol&) End Sub
@+
-----Message d'origine-----
Bonjour à tous, Salut,
Je cherche à changer la couleur de la barre d'un Userform
qui apparait en bleu dégradé par défaut.
il me semble que cela dépend du paramétrage de windows ... la fenêtre aura
la couleur définie dans les paramètres visuels de windows.
GAB.
.
Bonjour,
en effet ces propriétes sont des propriétés windows
on peut depuis Excel intervenir via VBA sur ces
propriétés, il faudra toutefois etre prudent dans la
modification des parametres !!!!!
dans un module :
'd'après KPD-Team 1998
'URL: http://www.allapi.net/
Declare Function GetSysColor Lib "user32" (ByVal nIndex As
Long) As Long
Declare Function SetSysColors Lib "user32" (ByVal nChanges
As Long, lpSysColor As Long, lpColorValues As Long) As Long
Const COLOR_SCROLLBAR = 0 'The Scrollbar colour
Const COLOR_BACKGROUND = 1 'Colour of the background with
no wallpaper
Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window
Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window
Const COLOR_MENU = 4 'Menu
Const COLOR_WINDOW = 5 'Windows background
Const COLOR_WINDOWFRAME = 6 'Window frame
Const COLOR_MENUTEXT = 7 'Window Text
Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95)
Const COLOR_CAPTIONTEXT = 9 'Text in window caption
Const COLOR_ACTIVEBORDER = 10 'Border of active window
Const COLOR_INACTIVEBORDER = 11 'Border of inactive window
Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop
Const COLOR_HIGHLIGHT = 13 'Selected item background
Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item
Const COLOR_BTNFACE = 15 'Button
Const COLOR_BTNSHADOW = 16 '3D shading of button
Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering
is used.
Const COLOR_BTNTEXT = 18 'Button text
Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive
window
Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button
Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active
window color
Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd
inactive window color
Sub ChangeActiveCaption()'---- change la couleur de la
barre de titre active
NomObjet$ = "COLOR_ACTIVECAPTION"
ObjetSystem& = 2 '----- voir ci-dessus liste des constantes
Oldcol& = GetSysColor(ObjetSystem&)
NewCol& = SetSysColors(1, ObjetSystem&, RGB(255, 0, 0))
reponse = MsgBox("La couleur de l'objet systeme " &
NomObjet$ & " était " & Str$(Oldcol&) _
& Chr(10) & " il est maintenant " & Str$(GetSysColor
(ObjetSystem&)), vbOKCancel + vbDefaultButton2)
If reponse = vbCancel Then t& = SetSysColors(1,
ObjetSystem&, Oldcol&)
End Sub
@+
-----Message d'origine-----
Bonjour à tous,
Salut,
Je cherche à changer la couleur de la barre d'un
Userform
qui apparait en bleu dégradé par défaut.
il me semble que cela dépend du paramétrage de
windows ... la fenêtre aura
la couleur définie dans les paramètres visuels de windows.
Bonjour, en effet ces propriétes sont des propriétés windows
on peut depuis Excel intervenir via VBA sur ces propriétés, il faudra toutefois etre prudent dans la modification des parametres !!!!!
dans un module : 'd'après KPD-Team 1998 'URL: http://www.allapi.net/ Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
Const COLOR_SCROLLBAR = 0 'The Scrollbar colour Const COLOR_BACKGROUND = 1 'Colour of the background with no wallpaper Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window Const COLOR_MENU = 4 'Menu Const COLOR_WINDOW = 5 'Windows background Const COLOR_WINDOWFRAME = 6 'Window frame Const COLOR_MENUTEXT = 7 'Window Text Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95) Const COLOR_CAPTIONTEXT = 9 'Text in window caption Const COLOR_ACTIVEBORDER = 10 'Border of active window Const COLOR_INACTIVEBORDER = 11 'Border of inactive window Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop Const COLOR_HIGHLIGHT = 13 'Selected item background Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item Const COLOR_BTNFACE = 15 'Button Const COLOR_BTNSHADOW = 16 '3D shading of button Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering is used. Const COLOR_BTNTEXT = 18 'Button text Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active window color Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd inactive window color
Sub ChangeActiveCaption()'---- change la couleur de la barre de titre active NomObjet$ = "COLOR_ACTIVECAPTION" ObjetSystem& = 2 '----- voir ci-dessus liste des constantes Oldcol& = GetSysColor(ObjetSystem&) NewCol& = SetSysColors(1, ObjetSystem&, RGB(255, 0, 0)) reponse = MsgBox("La couleur de l'objet systeme " & NomObjet$ & " était " & Str$(Oldcol&) _ & Chr(10) & " il est maintenant " & Str$(GetSysColor (ObjetSystem&)), vbOKCancel + vbDefaultButton2)
If reponse = vbCancel Then t& = SetSysColors(1, ObjetSystem&, Oldcol&) End Sub
@+
-----Message d'origine-----
Bonjour à tous, Salut,
Je cherche à changer la couleur de la barre d'un Userform
qui apparait en bleu dégradé par défaut.
il me semble que cela dépend du paramétrage de windows ... la fenêtre aura
la couleur définie dans les paramètres visuels de windows.
GAB.
.
Denys
Bonjour Gab et Modeste,
Merci pour vos réponses.... et en particulier Modeste pour tout le code....
En effet, ce n'est pas si simple...Pour être franc, ils se contenteront du bleu... L'esthétique, c'est pas si important dans ce cas-ci...
Merci à vous deux, et bonne journée
Denys
-----Original Message----- Bonjour, en effet ces propriétes sont des propriétés windows
on peut depuis Excel intervenir via VBA sur ces propriétés, il faudra toutefois etre prudent dans la modification des parametres !!!!!
dans un module : 'd'après KPD-Team 1998 'URL: http://www.allapi.net/ Declare Function GetSysColor Lib "user32" (ByVal nIndex As
Long) As Long Declare Function SetSysColors Lib "user32" (ByVal nChanges
As Long, lpSysColor As Long, lpColorValues As Long) As Long
Const COLOR_SCROLLBAR = 0 'The Scrollbar colour Const COLOR_BACKGROUND = 1 'Colour of the background with no wallpaper Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window
Const COLOR_MENU = 4 'Menu Const COLOR_WINDOW = 5 'Windows background Const COLOR_WINDOWFRAME = 6 'Window frame Const COLOR_MENUTEXT = 7 'Window Text Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95) Const COLOR_CAPTIONTEXT = 9 'Text in window caption Const COLOR_ACTIVEBORDER = 10 'Border of active window Const COLOR_INACTIVEBORDER = 11 'Border of inactive window Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop Const COLOR_HIGHLIGHT = 13 'Selected item background Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item Const COLOR_BTNFACE = 15 'Button Const COLOR_BTNSHADOW = 16 '3D shading of button Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering
is used. Const COLOR_BTNTEXT = 18 'Button text Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active window color Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd inactive window color
Sub ChangeActiveCaption()'---- change la couleur de la barre de titre active NomObjet$ = "COLOR_ACTIVECAPTION" ObjetSystem& = 2 '----- voir ci-dessus liste des constantes
If reponse = vbCancel Then t& = SetSysColors(1, ObjetSystem&, Oldcol&) End Sub
@+
-----Message d'origine-----
Bonjour à tous, Salut,
Je cherche à changer la couleur de la barre d'un Userform
qui apparait en bleu dégradé par défaut.
il me semble que cela dépend du paramétrage de windows ... la fenêtre aura
la couleur définie dans les paramètres visuels de windows.
GAB.
.
.
Bonjour Gab et Modeste,
Merci pour vos réponses.... et en particulier Modeste pour
tout le code....
En effet, ce n'est pas si simple...Pour être franc, ils se
contenteront du bleu... L'esthétique, c'est pas si
important dans ce cas-ci...
Merci à vous deux, et bonne journée
Denys
-----Original Message-----
Bonjour,
en effet ces propriétes sont des propriétés windows
on peut depuis Excel intervenir via VBA sur ces
propriétés, il faudra toutefois etre prudent dans la
modification des parametres !!!!!
dans un module :
'd'après KPD-Team 1998
'URL: http://www.allapi.net/
Declare Function GetSysColor Lib "user32" (ByVal nIndex
As
Long) As Long
Declare Function SetSysColors Lib "user32" (ByVal
nChanges
As Long, lpSysColor As Long, lpColorValues As Long) As
Long
Const COLOR_SCROLLBAR = 0 'The Scrollbar colour
Const COLOR_BACKGROUND = 1 'Colour of the background with
no wallpaper
Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window
Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive
window
Const COLOR_MENU = 4 'Menu
Const COLOR_WINDOW = 5 'Windows background
Const COLOR_WINDOWFRAME = 6 'Window frame
Const COLOR_MENUTEXT = 7 'Window Text
Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95)
Const COLOR_CAPTIONTEXT = 9 'Text in window caption
Const COLOR_ACTIVEBORDER = 10 'Border of active window
Const COLOR_INACTIVEBORDER = 11 'Border of inactive window
Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop
Const COLOR_HIGHLIGHT = 13 'Selected item background
Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item
Const COLOR_BTNFACE = 15 'Button
Const COLOR_BTNSHADOW = 16 '3D shading of button
Const COLOR_GRAYTEXT = 17 'Grey text, of zero if
dithering
is used.
Const COLOR_BTNTEXT = 18 'Button text
Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive
window
Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button
Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active
window color
Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd
inactive window color
Sub ChangeActiveCaption()'---- change la couleur de la
barre de titre active
NomObjet$ = "COLOR_ACTIVECAPTION"
ObjetSystem& = 2 '----- voir ci-dessus liste des
constantes
Merci pour vos réponses.... et en particulier Modeste pour tout le code....
En effet, ce n'est pas si simple...Pour être franc, ils se contenteront du bleu... L'esthétique, c'est pas si important dans ce cas-ci...
Merci à vous deux, et bonne journée
Denys
-----Original Message----- Bonjour, en effet ces propriétes sont des propriétés windows
on peut depuis Excel intervenir via VBA sur ces propriétés, il faudra toutefois etre prudent dans la modification des parametres !!!!!
dans un module : 'd'après KPD-Team 1998 'URL: http://www.allapi.net/ Declare Function GetSysColor Lib "user32" (ByVal nIndex As
Long) As Long Declare Function SetSysColors Lib "user32" (ByVal nChanges
As Long, lpSysColor As Long, lpColorValues As Long) As Long
Const COLOR_SCROLLBAR = 0 'The Scrollbar colour Const COLOR_BACKGROUND = 1 'Colour of the background with no wallpaper Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window
Const COLOR_MENU = 4 'Menu Const COLOR_WINDOW = 5 'Windows background Const COLOR_WINDOWFRAME = 6 'Window frame Const COLOR_MENUTEXT = 7 'Window Text Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95) Const COLOR_CAPTIONTEXT = 9 'Text in window caption Const COLOR_ACTIVEBORDER = 10 'Border of active window Const COLOR_INACTIVEBORDER = 11 'Border of inactive window Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop Const COLOR_HIGHLIGHT = 13 'Selected item background Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item Const COLOR_BTNFACE = 15 'Button Const COLOR_BTNSHADOW = 16 '3D shading of button Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering
is used. Const COLOR_BTNTEXT = 18 'Button text Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active window color Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd inactive window color
Sub ChangeActiveCaption()'---- change la couleur de la barre de titre active NomObjet$ = "COLOR_ACTIVECAPTION" ObjetSystem& = 2 '----- voir ci-dessus liste des constantes