Print Page | Close Window

HOWTO: Change Color Gradient of Toolbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=5201
Printed Date: 03 May 2025 at 12:30pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: Change Color Gradient of Toolbar
Posted By: DDJJ
Subject: HOWTO: Change Color Gradient of Toolbar
Date Posted: 03 October 2006 at 9:48am
We're going to let our users select a style, just like you have done in your RibbonBar sample, using code like the following:
 
CommandBarsGlobalSettings.Office2007Images = App.Path & "\Styles\Office2007Aqua.dll"
CommandBars.PaintManager.RefreshMetrics
CommandBars.RecalcLayout
 
This works fine for the main form of our app, but on the various subforms of the app we use a cj Toolbar as the controlbox of each form, and we want a consistent appearance of the subform regardless of which style the user elects to use on the main form.
 
I've tried changing the gradient on the toolbar of the subforms without success (the colors used seem to be determined by which style is being used).  If this because I'm using the above code ("CommandBarsGlobalSettings"), or can someone point out how you change the colors on a toolbar...which color settings control the appearance of the toolbar gradient?
 
Thanks.
 
Dan
 



Replies:
Posted By: cj_user
Date Posted: 03 October 2006 at 12:37pm

Had the same issue and after looking around in this forum I saw that you need to set LunaColors to False

CommandBars.Options.LunaColors = False
 
After that all my SetSpecialColor calls were working


Posted By: DDJJ
Date Posted: 03 October 2006 at 2:38pm
Thanks.
 
I'm doing what you suggest, but still not getting the colors to change, as follows:
 
With objCB
        .VisualTheme = xtpThemeRibbon
        .Options.LunaColors = False
        .ActiveMenuBar.Visible = False
        .ActiveMenuBar.ContextMenuPresent = False
        .ActiveMenuBar.Customizable = False
        .Options.AlwaysShowFullMenus = False
        .Options.ShowExpandButtonAlways = False
        .EnableCustomization False
        .Options.UpdatePeriod = 100
        .Options.UseDisabledIcons = True
        .Options.SetIconSize False, 16, 16
        .Options.IconsWithShadow = True
        .SetSpecialColor XPCOLOR_TOOLBAR_FACE, vbBlack
        .RecalcLayout
 End With
 
See the following picture for what I am trying to change (the control box/CJToolbar is a blueish color probably derived from the Aqua theme; I want it to be a light greyish gradiant).
 
 


Posted By: cj_user
Date Posted: 03 October 2006 at 3:42pm
I tried different Visual Themes and the only themes that it seems to allow you to do that are: xtpThemeOffice2000 = 0, xtpThemeOfficeXP = 1, xtpThemeOffice2003 = 2,
 
sorry couldnt be of more help :{


Posted By: DDJJ
Date Posted: 03 October 2006 at 5:54pm
Thanks cj_user.
 
Oleg, could you confirm this?  Although I really like how themes make our main form "sing", I really didn't want to have to use related colors on all other forms in the app.
 
Dan


Posted By: Oleg
Date Posted: 04 October 2006 at 12:40am
Hi,
 
I not sure where problem :(
 
If you use VisualTheme = xtpThemeRibbon it will look like Office2007 theme. If you dont[' want it , don't set this theme. Try xtpThemeOffice2003 or something.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: DDJJ
Date Posted: 04 October 2006 at 12:42pm
Oleg, the problem is we like the 2007 theme on our main form, and we want to use it for that reason.  We don't however, like the theme's appearance when used on all of the other various forms used by our application.
 
Can I assume from your response that cj_user is correct when stating that you cannot customize toolbar colors when the VisualTheme is set to xtpThemeRibbon?
 


Posted By: Oleg
Date Posted: 05 October 2006 at 10:20am
Hello,
 
yes, for Ribbon/Office2007 themes you can't change it.
Used predefined values.
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net