delphi - How to change color of TDateTimePicker? -
how change color of tdatetimepicker
?
a date , time picker can have color:
normally done setting color:
procedure tform1.formcreate(sender: tobject); begin datetimepicker1.color := cllime; end;
but when using version 6 of date , time picker control, color no longer works:
i tried using setwindowtheme
disable style of tdatetimepicker
:
procedure tform1.formcreate(sender: tobject); begin uxtheme.setwindowtheme(datetimepicker1.handle, '', ''); datetimepicker1.color := cllime; end;
but made angry:
how change color of datetimepicker?
i going settle patching vcl:
procedure tdatetimepicker.createwnd; var lchecked: boolean; begin lchecked := fchecked; inherited createwnd; setchecked(lchecked); if length(fformat) > 0 datetime_setformat(handle, fformat); //20140911 fix .color property not working if self.handleallocated winapi.uxtheme.setwindowtheme(self.handle, '', ''); end;
but disabling theme of window doesn't it.
bonus chatter
you can change color of version 6 tcombobox
theme styles still applied it:
so it's not fundamental limitation of common controls version 6 or visual styles.
duplicate?
i think not.
- that question deals how make datetime picker honor active delphi style
- this question deals hot make datetime picker not honor active delphi style
and answers in questions not let change color; need do.
it's more ridiculous suggest answers apply, since style hooks if using non-standard (delphi) style.
how change color of tdatetimepicker?
for v6 comctl32 cannot.
so it's not fundamental limitation of common controls version 6 or visual styles.
well, yes is. yes, v6 comctl32 allows user specified color combo boxes. not date time pickers?
in order result desire need take on painting control, disabling themes control , handling both wm_erasebkgnd
, wm_paint
. rodrigo demonstrates here: style properties tdatetimepicker. not whole load of fun honest. need paint entire control.
this you'll need used v6 comctl32. wants in charge of theme , style of controls. if want vary have less freedom had in olden times.
Comments
Post a Comment