Danke für die Antwort, hab aber schon eine möglichkeit gefunden...
[delphi]
procedure TForm1.Button5Click(Sender: TObject);
var i, ic, w2: Integer;
DC: HDC;
Size: TSize;
begin
// Passt alle Horizontalen ListBoxenScroller der breite an
for ic:= 0 to ComponentCount-1 do
begin
if (Components[ic] is TListBox )and
(TListBox(Components[ic]).Items.Count > 0)then
begin
w2:=0;
for i:= 0 to TListBox(Components[ic]).Items.Count-1 do
begin
dc:= GetDC(0);
SelectObject(
dc,TListBox(Components[ic]).Font.Handle);
if GetTextExtentPoint32(
DC,
PChar(TListBox(Components[ic]).Items[i]),
StrLen(PChar(TListBox(Components[ic]).Items[i])),
Size)
then
begin
if w2 < size.cx then w2:= size.cx;
releasedc(0,
dc);
end;
end;
TListBox(Components[ic]).ScrollWidth:= w2+10;
end;
end;
end;