Registriert seit: 9. Nov 2005
Ort: Bamberg
55 Beiträge
Delphi 2005 Personal
|
Re: Delphi Cleaner 1.1 [updated]
28. Sep 2006, 08:20
Hallo,
Aus SwissDelphiCenter
...in einer Listbox einen horizontalen Scrollbalken anzeigen?
Autor: Thomas Stutz
Delphi-Quellcode:
procedure HorScrollBar(ListBox: TListBox; MaxWidth: Integer);
var
i, w: Integer;
begin
if MaxWidth = 0 then
SendMessage(ListBox.Handle, LB_SETHORIZONTALEXTENT, MaxWidth, 0)
else
begin
{ get largest item }
for i := 0 to ListBox.Items.Count - 1 do
with ListBox do
begin
w := Canvas.TextWidth(Items[i]);
if w > MaxWidth then
MaxWidth := w;
end;
SendMessage(ListBox.Handle, LB_SETHORIZONTALEXTENT,
MaxWidth + GetSystemMetrics(SM_CXFRAME), 0);
end;
end;
Fuchtel
|
|
Zitat
|