Arsip: Menambahkan skrolbar horisonal pada listbox


by LuriDarmawan in Articles more 18 years ago 2274
Pada kondisi default, listbox tidak memiliki skrolbar horisontal.

Jika ingin menambahkan skrolbar horisonal pada suatu komponen listbox,
bisa digunakan prosedur berikut:
procedure SetHorizontalScrollBar(lb : TListBox) ;
var
j, MaxWidth: integer;
begin
MaxWidth := 0;
for j := 0 to lb.Items.Count - 1 do
if MaxWidth < lb.Canvas.TextWidth(lb.Items[j]) then
MaxWidth := lb.Canvas.TextWidth(lb.Items[j]) ;
SendMessage(lb.Handle,
LB_SETHORIZONTALEXTENT,
MaxWidth + 5, 0) ;
end;
Syntax Highlighted with https://pascal-id.org/syntax


Penggunaan:

SetHorizontalScrollBar(ListBox1) ;
Syntax Highlighted with https://pascal-id.org/syntax


Selamat Mencoba.

Coinfest

Pascal Indonesia is Coinfest Asia 2024's official community partner! 🀝
β˜€οΈ Take part in Asia’s immersive Web3 festival, where innovation meets adoption.
🎟 Get your tickets at www.coinfest.asia and use our special promo code : CA24PASCALINDO to get 10% off!

Why Coinfest Asia?
● Unconventionally Engaging
Our immersive setting and programming leave you with more memory markers than any other event
● Dive into Emerging Markets
Get connected in Southeast Asia; the fastest-growing Web3 region in the world
● Jump straight into Adoption
Foster collaborations directly in Indonesia where there are 437k new crypto users each month

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com