Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.
In this article I want to introduce two template classes, that can help you in simple dialog development. Very frequently we try to set different color or font to static, editbox or another control in our dialog. To simplify this work I wrote two classes
. These classes have two advantages. First of all, you don’t need to throw out your beloved class. Because these classes are templates – they can be attached to any existing CWnd-based class. Second, there is no painting of any kind in these classes.
Control works in one of two modes:
Simple Colored Mode
You can customise:
If your control uses
message for painting (as almost all standard windows controls do), you can use this template. Use it also for whole dialog (see "About" dialog in system menu).
Include ColorCtrl.h in your project. Create control with dialog editor. Add member variable for this control with class wizard. Replace
Developer.com features tutorials, news, and how-tos focused on topics relevant to software engineers, web developers, programmers, and product managers of development teams. In addition to covering the most popular programming languages today, we publish reviews and round-ups of developer tools that help devs reduce the time and money spent developing, maintaining, and debugging their applications. This includes coverage of software management systems and project management (PM) software - all aimed at helping to shorten the software development lifecycle (SDL).
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.