Print Page | Close Window

Background on custom common controls?

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=838
Printed Date: 06 July 2025 at 10:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Background on custom common controls?
Posted By: Ark42
Subject: Background on custom common controls?
Date Posted: 14 June 2004 at 4:33pm
Does anybody have a good idea of how to get the blue gradient as the background for common controls? See the CommonControls sample for what I mean, but that sample only uses the office 2000 theme, probably for this reason.

I can override CMainFrame::OnCtlColor and return a new solid brush for the background color, which would let it work with the Office XP theme and blend in correctly, but I don't see any good way to put a gradient underneith the common controls.

I have also tried deriving a class from CSliderCtrl and overriding OnPaint to use CXTMemDC, but the gradient from the toolbar still does not show through ever, I just end up with the hall-of-mirrors type effect.




Replies:
Posted By: Kenneth
Date Posted: 26 June 2004 at 7:22pm

I have done this type of thing with CDialogBar, where I want the background of the CDialogBar to reflect the current theme colors.  The CSliderCtrl is a bit more difficult since it is drawn in stages (see http://www.codeproject.com/miscctrl/transparentslider.asp?print=true - http://www.codeproject.com/miscctrl/transparentslider.asp?pr int=true ). 

You would also have to call something like:

 XTPPaintManager()->GradientFill(pDC,rc,XTPPaintMana ger()->GetXtremeColor(XPCOLOR_BASE),XTPPaintManager()-> ;GetXtremeColor(55),FALSE); in order to get the proper gradient fill.  I suspect this would be a bit tricky since you are only filling a portion of the CommandBar (the slider itself).




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