Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Background on custom common controls?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Background on custom common controls?

 Post Reply Post Reply
Author
Message
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Topic: Background on custom common controls?
    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
Back to Top
Kenneth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 May 2004
Location: United States
Status: Offline
Points: 256
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kenneth Quote  Post ReplyReply Direct Link To This Post 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?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).

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.