How do you draw a Taskbar button using visual styl

2020-08-01 08:30发布

问题:

I've created a DeskBand toolbar and I want to display a button on the toolbar that has the style visual style as a taskbar button.

In .NET you can use the VisualStyleRenderer to render the Taskbar BACKGROUND, but there's way to render a button.

Are there any Win32 API's I can use to draw the button using Visual Styles rather than emulating the look of the button via drawing paths or images?

回答1:

I know this topic is old but,...:

http://msdn.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstyleelement.taskband.flashbuttongroupmenu.aspx



回答2:

So far, I have only been able to find a solution that reportedly works on Vista according to the forum discussion linked. It would seem that the UxTheme.dll for XP does not support the retrieval of subclasses, which is what you require to reliably obtain the TaskBand button visual style elements for the current theme, it would appear.