Ownerdraw CProgressCtrl with XP Themes
-
Hi, I have derived a class from CProgressCtrl. In OnPaint() I do my painting of the current progress which works fine. But there is a problem when the application uses XP themes: There is no border drawn around the control. I can draw the border myself, but then I got problems with win2000 (-> 2 borders). Does anyone know how to enable the border for a ownerdraw progress control ? thanks
-
Hi, I have derived a class from CProgressCtrl. In OnPaint() I do my painting of the current progress which works fine. But there is a problem when the application uses XP themes: There is no border drawn around the control. I can draw the border myself, but then I got problems with win2000 (-> 2 borders). Does anyone know how to enable the border for a ownerdraw progress control ? thanks
You use
DrawThemeBackground()
to paint a themed control. For a progress bar, call it with thePP_BAR
part to draw the border/background, then call it with thePP_CHUNK
part to draw the progress indicator.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer
-
You use
DrawThemeBackground()
to paint a themed control. For a progress bar, call it with thePP_BAR
part to draw the border/background, then call it with thePP_CHUNK
part to draw the progress indicator.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer
Hi, thank you for your fast reply. I think DrawThemeBackground with PP_BAR will draw the "theme'd" border with round edges. What I want to do is a progress control that looks like a sunken static. The control should just look like a non themed control.
-
Hi, thank you for your fast reply. I think DrawThemeBackground with PP_BAR will draw the "theme'd" border with round edges. What I want to do is a progress control that looks like a sunken static. The control should just look like a non themed control.
ah, in that case I would recommend just drawing the entire control (border and all) so it looks consistent across all OSes.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer
-
ah, in that case I would recommend just drawing the entire control (border and all) so it looks consistent across all OSes.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer
Yes, ok that's what I want to do. But 1.) Win2000 and 2.) Win XP with DEACTIVATED themes draw the border alone. I can't prevent this. And 3.) Windows XP with themes ACTIVATED doesn't draw the border. So if I put some code in the OnPait Proc. to draw a border, the control looks fine in condition 3.). But in condition 1.) + 2.) I got two borders: The one that I draw myself and the one that the OS draw. So I don't know how to solve this...
-
Yes, ok that's what I want to do. But 1.) Win2000 and 2.) Win XP with DEACTIVATED themes draw the border alone. I can't prevent this. And 3.) Windows XP with themes ACTIVATED doesn't draw the border. So if I put some code in the OnPait Proc. to draw a border, the control looks fine in condition 3.). But in condition 1.) + 2.) I got two borders: The one that I draw myself and the one that the OS draw. So I don't know how to solve this...
Oh, sorry, I didn't finish my thought in my earlier post. It would probably be easier to draw the entire thing yourself (that's where I was going with the "so it looks the same on all OSes"). Use some other control like a button that has an owner-draw style, and then do all the drawing in response to the
WM_DRAWITEM
message sent by the control.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer