Jest, jest ! Działa. Znalazłem ! Może się komuś przyda :)
CheckListBox1.Items.Add('długi tekst - dsafdsds aus98bt98ebt98bs49865e9546h98546h98d5h76y9');
CheckListBox1.ScrollWidth := CheckListBox1.ClientWidth + 90;
lub można też tak:
private
procedure AdjustCheckListBox;
procedure TForm1.AdjustCheckListBox;
var
i, nMaxWidth, nItemWidth : integer;
begin
nMaxWidth := CheckListBox1.ClientWidth;
for i := 0 to CheckListBox1.Items.Count - 1 do
begin
nItemWidth := Length(CheckListBox1.Items[i]) * 5 + 90;
if (nItemWidth > nMaxWidth) then
nMaxWidth := nItemWidth;
end;
if (nMaxWidth > CheckListBox1.ClientWidth) then
CheckListBox1.ScrollWidth := nMaxWidth;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
CheckListBox1.Items.Add('długi tekst - aaaaadsgfdsgs e9t nse9t6be94b64be698edsgdsfgfdge576e4575767656587684b96e4nh596nh5nhr765hy6985a');
AdjustCheckListBox;
end;
Zródełko :) http://forums.devshed.com/t174339/s.html