Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu bar color

Status
Not open for further replies.

JanyMoon

Programmer
Oct 17, 2005
12
SI
Can I change or set color of menu bar ( _screen.something = )?
 
The colour of the menu bar is set by the user from Control Panel for all applications and Fox respects that setting.

There are API calls to override the colour but if you make that change then you'll get complaints from your users. I don't know where you're based but in the UK some of these complaints will be backed by the Disability Discrimination Act.

Geoff Franklin
 
JanyMoon.

This will do it, but as Geoff says, it changes every title bars on your system including non-fox ones.
Code:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
Top = 114
Left = 197
DoCreate = .T.
Caption = "Form1"
l = 6956042
ADD OBJECT command1 AS commandbutton WITH ;
AutoSize = .T., ;
Top = 24, ;
Left = 96, ;
Height = 27, ;
Width = 208, ;
Caption = "Changer la couleur de la barre titre", ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
AutoSize = .T., ;
Top = 78, ;
Left = 110, ;
Height = 27, ;
Width = 181, ;
Caption = "Remettre la couleur original", ;
Name = "Command2"
PROCEDURE changerlacouleurdelabarredetitre
LPARAMETERS NewColor
#DEFINE COLOR_ACTIVECAPTION  2
Local lRet
lRet = SetSysColors(1, COLOR_ACTIVECAPTION, NewColor)
ChangeTitleBarColor = lRet > 0
ENDPROC
PROCEDURE trouverlacouleur
GetTitleBarColor1 = GetSysColor(COLOR_ACTIVECAPTION)
Return GetTitleBarColor1
ENDPROC
PROCEDURE Load
DECLARE INTEGER GetSysColor IN user32 INTEGER nIndex
DECLARE INTEGER SetSysColors IN user32;
    INTEGER nChanges,;
    INTEGER @ lpSysColor,;
    INTEGER @ lpColorValues

ENDPROC
PROCEDURE command1.Click
thisform.l = thisform.trouverlacouleur()
thisform.changerlacouleurdelabarredetitre(RGB(255, 0, 0))
ENDPROC
PROCEDURE command2.Click
thisform.changerlacouleurdelabarredetitre(thisform.l)
ENDPROC

ENDDEFINE




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top