Click here to Skip to main content
13,201,452 members (73,347 online)
Click here to Skip to main content
Add your own
alternative version


18 bookmarked
Posted 1 Dec 2003

Buttons and Floating containers supporting user defined themes

, 1 Dec 2003
Rate this:
Please Sign up or sign in to vote.
Provides an XP look and feel over which you have ultimate control

Sample screenshot


It seems every developer that hits DotNet wants to produce some buttons. However, these buttons are not part of a big picture. What I am trying to do here is produce a theme system, that control developers use to draw their controls. When a user sees a control which has adopted the theme system it looks to them like it "belongs", i.e. it's basically drawn in the same style and color scheme as all other elements in their user interface.

I am seeking others to collaborate with, intially in VB.NET with others doing conversions to other .NET languages. The aim being to develop a full and useful range of controls which have adopted the theme system.


A detailed study of the CtlButton and CtlFloatbar source code may be required to understand how a theme is adopted, but a quick look at the enclosed demo, which will need minimal edits before it will run, will immediately demonstrate the objective.

The code uses minimal API techniques and is written in VB.NET using .NET 1.0. It calls upon the Graphics class by using the VisualTheme class to provide critical information which affects the way in which a control is drawn. For example, when opening a form, the theme can dictate the forms background color. The theme also governs the 3D look of buttons and even supports caption buttons as you see in Windows own caption bars. The theme affects the borders of button controls in this example, so that the user can see which the Default (Accept) buttons is, which is the Cancel/Abort buttons, which button has focus and which control is being pointed to by the mouse.

The system also demonstrates a primitive system for drawing drop shadows beneath controls. The VisualTheme class is also called upon to perform this task, it's slow, but all this stuff is to demonstrate a concept which hopefully others will assist me in completing.


Comments to are all welcomed together with offers of collaboration. Ownerships is not an issue here, but quality is, so lets work for the greater good.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Australia Australia
English guy now living in Australia. Developed in VB/C++ and assembler for many years. Just begun working with .NET. Keen to develop many resuable components. Have great system at home.

You may also be interested in...


Comments and Discussions

GeneralTesters Required Pin
cnurse8-Jan-04 15:09
susscnurse8-Jan-04 15:09 
GeneralUpdated version planned soon Pin
cnurse8-Dec-03 2:35
membercnurse8-Dec-03 2:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171020.1 | Last Updated 2 Dec 2003
Article Copyright 2003 by cnurse
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid