Listbox Enine*ScrollBar Ekleme. Site de Bulunsun Diye Ekledim.
procedure TForm1.SetHorizontalScrollBar(ListBox: TListBox);
var
*EN_Pix, i: Integer;
begin
*EN_Pix := ListBox.ClientWidth;
*for i := 0 to ListBox.Items.Count - 1 do
*begin
* *if EN_Pix < Canvas.TextWidth(ListBox.Items) then
* *begin
* * *EN_Pix := Canvas.TextWidth(ListBox.Items);
* *end;
* *if EN_Pix > ListBox.ClientWidth then
* *begin
* * *Inc(EN_Pix, 4);
* *end;
* *ListBox.Perform(LB_SETHORIZONTALEXTENT, EN_Pix, 0);
*end;
end;
procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
begin
*SetHorizontalScrollBar(ListBox1);
end;
procedure TForm1.SetHorizontalScrollBar(ListBox: TListBox);
var
*EN_Pix, i: Integer;
begin
*EN_Pix := ListBox.ClientWidth;
*for i := 0 to ListBox.Items.Count - 1 do
*begin
* *if EN_Pix < Canvas.TextWidth(ListBox.Items) then
* *begin
* * *EN_Pix := Canvas.TextWidth(ListBox.Items);
* *end;
* *if EN_Pix > ListBox.ClientWidth then
* *begin
* * *Inc(EN_Pix, 4);
* *end;
* *ListBox.Perform(LB_SETHORIZONTALEXTENT, EN_Pix, 0);
*end;
end;
procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
begin
*SetHorizontalScrollBar(ListBox1);
end;