15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Color Button

Richard Stott -- rstott@redshift.com
Tuesday, May 14, 1996

Win 95 VC++ 4.1

I'm trying to colorize some pushbuttons in a dialog bar. For my first try I
copied the class CColorButton from Color Property Page (Ppgcolor.cpp) with
supporting code and used SetFaceColor to set an rgb color. So far all I can
get is a grey rectangle (same color as the dialog bar) which thickens upon
selection. The messaging seems to be working (Draw Item switches to
ODA_DRAWENTIRE).

Can anyone shed light on this uninteresting behavior? Is this a blind alley
as far as creating color 3D style pushbuttons? Is there a better way?

Thanks for any help.

Dick Stott





David Ohlssen -- DAVIDO@COMMERCE.CTECH.AC.ZA
Friday, May 17, 1996

Dont know about dlg bar but for dlg:
Just select ownerdraw on the button properties, derive a class from 
CButton and override the draw.   Then you can draw a rectangle with 
your own color, use your own font for the text and even test for 
button state and show a thick button that REALLY pushes in when 
pressed.  Watch font sizes versus dlgunits etc for different screen 
resolutions, also test w95 and nt for different system font size.
Keep this new button class on your gallery.

> I'm trying to colorize some pushbuttons in a dialog bar. For my first try I

David O. Ohlssen
I  _____________________________________  I
I  | Davido@Commerce.CTech.ac.ZA       |  I
I  |    __  ____________               |  I
I  |   /  \/ Cape Town  \  _           |  I
I  |__/     South Africa \/ \__________|  I
I_________________________________________I




| Вернуться в корень Архива |