Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Font dialog and color option

Status
Not open for further replies.

gelbert

Programmer
Nov 6, 2001
2
US
Hi!
It is simple. I need to display font dialog in where standard control (combobox) to select font
color is substituted with custom control to select color. I use custom dialog template (I modified original
template) where all controls except my custom one have standard IDs taken from original template. I
use ChooseFont() API function to display dialog.
Problem is that dialog ignores my attempts to reset font color using m_cf.rgbColors and displays
text in "Sample" control as black always. It always assumes that color is black. For example: if user selects RED as color and I set m_cf.rgbColors to RGB(255,0,0), it keeps that data in m_cf.rgbColors but I see text in "Sample" control as black.
My guess that instead of checking value of m_cf.rgbColors it attempts to access standard control, could
not find it and uses default RGB(0,0,0).
Is there a way to override some handler to force text in "Sample" control to be painted with correct color?
 
Check out the flag CF_INITTOLOGFONTSTRUCT of the CHOOSEFONT structure. Also check the other flags specified for these structure.

--Just a guess, hope is the right one.-- s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top