Click here to Skip to main content
Click here to Skip to main content

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

Introduction

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.

Details

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.

Conclusion

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

License

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

Share

About the Author

cnurse
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.

Comments and Discussions

 
GeneralTesters Required Pinsusscnurse8-Jan-04 15:09 
GeneralUpdated version planned soon Pinmembercnurse8-Dec-03 2:35 

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

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

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 2 Dec 2003
Article Copyright 2003 by cnurse
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid