Click here to Skip to main content
15,893,814 members
Articles / Programming Languages / Visual Basic
Article

Buttons and Floating containers supporting user defined themes

Rate me:
Please Sign up or sign in to vote.
2.79/5 (13 votes)
1 Dec 20032 min read 52.3K   337   18   2
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


Written By
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 Pin
cnurse8-Jan-04 15:09
cnurse8-Jan-04 15:09 
If you would like to be involved in testing a new system for developing themes which can be utilised in control development then please send an email to dev@bobbieandchris.com.

Some testers will receive source code, to assist in bug reports and some will not, as they will be designated as testing for release.

All offers will be seriously considered, but you must have something genuine to offer such as a reasonable amount of time and maybe an idea for a control that you want to develop, no matter how simple. All controls must promote the idea of themeing.

Together we will develop a set of controls that use themes such that when the colors in the theme are changed, all the controls reflect these changes, even in the shapes used to draw the controls.

Drop me a line and I will send you a document, containing a description of the system, with screen shots, so you can decide if this is the thing for you.

You must be committed to formally testing, in so far as, you can do anything you want when running the system, but bug reports will only be accepted on a formal statement, which will be emailed to you so you can send it back completed as many times as is required.

All offers appreciated.

Chris.

Nursey
GeneralUpdated version planned soon Pin
cnurse8-Dec-03 2:35
cnurse8-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.