delphi - TButton deficiencies -
delphi - TButton deficiencies -
tbutton in delphi xe2 has style
property. when property set bssplitbutton
drop-down arrow displayed on right side of button:
however, drop-down area has inconveniences:
in many cases narrow, static width of drop-down area 11 pixels.
there no explicit hover indication drop-down area when mouse pointer hovers on drop-down area.
how can descendant of tbutton implemented repairs inconveniences? descendant should have dropdownwidth
property , property handles , changes drop-down display when mouse hovers on drop-down area.
your descendant must phone call button_splitinfo
(or send bcm_setsplitinfo
) adjust split width. below run-time illustration usage, can integrate similar functionality in descendant:
procedure setbuttonsplitwidth(button: tbutton; width: integer); var info: tbuttonsplitinfo; begin if button.style = bssplitbutton begin info.mask := bcsif_size; info.size.cx := width; info.size.cy := 0; button_setsplitinfo(button.handle, info); button.invalidate; end; end;
sample result call
setbuttonsplitwidth(button2, 25);
is this:
see documentation else can do. there's no functionality modifies hovering behavior native button control. that, improve not start tbutton
.
delphi delphi-xe2 split-button
Comments
Post a Comment