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