Background on custom common controls? |
Post Reply |
Author | |
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
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. Edited by Ark42 |
|
Kenneth
Senior Member Joined: 23 May 2004 Location: United States Status: Offline Points: 256 |
Post Options
Thanks(0)
|
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?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). |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |