Changing a objects looks

Posted on 1998-12-09
Last Modified: 2012-05-04
I am trying to alter the objects on the screen, ie. buttons, edit boxes, and so on.

I want to be able to set each objects properties such as font type and size, foreground, background, and text colors?

Thanks in advance
Question by:DanielJenkins
  • 3
  • 2

Expert Comment

ID: 1179781
What compiler and library are you using?
LVL 22

Expert Comment

ID: 1179782
That's sort of a broad question.   can you narrow it some?

Author Comment

ID: 1179783
The Compiler I am using is MS VC++ 5.0.

I have programmed a bit in VB 5.0 and each control: buttons, edit boxes, text boxes, and list & combo boxes, on each of these the programmer can set the font attributes such as:
* size
* bold
* type of font(times roman, courier, or ms san serif)
* foreground color
* background color

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 22

Accepted Solution

nietod earned 150 total points
ID: 1179784
Some of these features can be set in a regular windows control using the WM_CTLCOLORXXX messages  (there are several with different "XXX"s).  These allow a parent window to control the color and fonts used in its child control windows.  These are easy to use, but they have limitations.  If they work for you, use them.  Otherwise, you need to sub-class the window controls and write your own procedures for drawing them.  This is quite hard to do.

Take a look at the control color messages and ask if you have questions.

Author Comment

ID: 1179785
OK that worked, but my buttons won't change color.
LVL 22

Expert Comment

ID: 1179786
Yeah, standard buttons don't seem to use this message system for much.  For those you need to sub-class, if it is important to you.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question