Hoi,
i have a function for TChecklistbox which adds a Horizontal Scrollbar to the CheckListBox.
This one does work.. but when i try it for TsCheckListBox it is not working.
any idea why?
CODE
procedure AddHScroll(DestListBox: TsCheckListBox);
const LB_SETHORIZONTALEXTENT = $0194;
var I, intWidth, intMaxWidth: Integer;
begin
intMaxWidth := 0;
for I := 0 to DestListBox.Items.Count – 1 do
begin
intWidth := DestListBox.Canvas.TextWidth(DestListBox.Items.Strings + 'X');
if (intMaxWidth < intWidth) then
intMaxWidth := intWidth;
end;
SendMessage(DestListBox.Handle, LB_SETHORIZONTALEXTENT, intMaxWidth + 20, 0);
end;