all groups > dotnet drawing api > april 2006 >
You're in the

dotnet drawing api

group:

Custom Scrollbars and WinXP Themes


Custom Scrollbars and WinXP Themes Shawn B.
4/25/2006 10:07:59 PM
dotnet drawing api:
Greetings,

How do I make a custom (derived from Control) Scrollbar (or other control)
participate in the WinXP theme schemes?


Thanks,
Shawn

Re: Custom Scrollbars and WinXP Themes Shawn B.
4/27/2006 10:33:52 AM
[quoted text, click to view]

Does anybody know?

As far as I can tell the DrawBorder3D function participates in the WinXP
theming already, so that part is taken care of (as well as all the other
ControlPaint methods). If I use the Windows or .NET Scrollbar they (can)
participate in the WinXP theming (probly the .NET scrollbar is the Windows
Scrollbar). But if I custom draw the scrollbar, clearly, I'm not
participating in the WinXP theming, I don't know know if there are API's to
allow me to.

I know that MS Office doesn't do too well of WinXP Theming, the scrollbars
do but nothing else does. I don't know if I want my application to behave
the same way. I'm not imitating Office in this case, anyway.

The best I can think of is to provide an option on my control,
UseOperatingSystemDefaults=true; (or similar concept implemented
differently) and instead of attempting to custom draw my arrows and thumb
tracker and so on, I would just use the standard Windows scrollbar (or .NET
Scrollbar in this case) and buttons and so on, so they can inherit the
Operating System theme, and if UseOperatingSystemDefaults=false; then I
would instead use my ScrollBarRenderProvider instead to handle drawing (or a
user of the control can provide their own provider).

I am not sure of any other way.

Does anyone here know of a better way?


Thanks,
Shawn

AddThis Social Bookmark Button