Página 1 de 1

TEditBtn button color

Publicado: Mar Oct 10, 2006 1:33 pm
por Oleg
Hello!
I made gray picture for button in TEditBtn control.
I want that this color is changing with Windows color scheme
(like combobox button):
gray scheme -> gray color of button,
blue scheme -> blue color of button.
How can I do it?
Thank you.
Oleg.

TEditBtn button color

Publicado: Mié Oct 11, 2006 8:18 pm
por Oleg
Any answer?

TEditBtn button color

Publicado: Mié Oct 11, 2006 8:18 pm
por Oleg
Any answer?

TEditBtn button color

Publicado: Jue Oct 12, 2006 9:46 am
por Oleg
Hello!
To make my question more clear:
I just want to make control like TMaskEdit (cPicture is important) with
standard button from TCombobox.
TEditBtn in Win98, WinXP has non-standard appearance.
Any ideas?
Thank you.
Oleg.

TEditBtn button color

Publicado: Jue Oct 12, 2006 9:46 am
por Oleg
Hello!
To make my question more clear:
I just want to make control like TMaskEdit (cPicture is important) with
standard button from TCombobox.
TEditBtn in Win98, WinXP has non-standard appearance.
Any ideas?
Thank you.
Oleg.

TEditBtn button color

Publicado: Dom Oct 15, 2006 8:06 pm
por jfgimenez
Oleg,
> I made gray picture for button in TEditBtn control.
> I want that this color is changing with Windows color scheme
> (like combobox button):
> gray scheme -> gray color of button,
> blue scheme -> blue color of button.
>
> How can I do it?
It's not so easy. One way to do it could be creating different bitmaps for
each theme or color scheme. You could do it at runtime by creating an empty
bitmap and using the API functions DrawFrameControl() or
DrawThemeBackground() to draw the bitmap. Then, create a TPicture object
from that bitmap (use the CreateIndirect() method) and assign it to the
oBitmap editbtn's property.
The other way is to create your own control derived from TEditBtn, and
rewriting its WMPaint method.
--
Regards,
Jose F. Gimenez
http://www.xailer.com

TEditBtn button color

Publicado: Dom Oct 15, 2006 8:06 pm
por jfgimenez
Oleg,
> I made gray picture for button in TEditBtn control.
> I want that this color is changing with Windows color scheme
> (like combobox button):
> gray scheme -> gray color of button,
> blue scheme -> blue color of button.
>
> How can I do it?
It's not so easy. One way to do it could be creating different bitmaps for
each theme or color scheme. You could do it at runtime by creating an empty
bitmap and using the API functions DrawFrameControl() or
DrawThemeBackground() to draw the bitmap. Then, create a TPicture object
from that bitmap (use the CreateIndirect() method) and assign it to the
oBitmap editbtn's property.
The other way is to create your own control derived from TEditBtn, and
rewriting its WMPaint method.
--
Regards,
Jose F. Gimenez
http://www.xailer.com

TEditBtn button color

Publicado: Lun Oct 16, 2006 8:01 am
por Oleg
Jose,
thanks for your advice. I will analyze it.
Regards,
Oleg

TEditBtn button color

Publicado: Lun Oct 16, 2006 8:01 am
por Oleg
Jose,
thanks for your advice. I will analyze it.
Regards,
Oleg