Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
CnVCL 组件包
» 怎样给TListBox加上ScrollBars属性
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: 怎样给TListBox加上ScrollBars属性
fql
新警察
UID 485
Digest Posts 0
Credits 1
Posts 1
点点分 1
Reading Access 10
Registered 2004-8-23
Status Offline
#1
Post at 2004-8-23 23:24
Profile
|
Blog
|
P.M.
怎样给TListBox加上ScrollBars属性
我仿照TCustomMemo的写法,但就是不行
zjy
管理员
UID 2
Digest Posts
6
Credits 2385
Posts 1543
点点分 2385
Reading Access 102
Registered 2002-12-16
Location China
Status Offline
#2
Post at 2004-8-24 13:12
Profile
|
Site
|
Blog
|
P.M.
可以参考一下这个函数:
// 为 Listbox 增加水平滚动条
procedure ListboxHorizontalScrollbar(Listbox: TCustomListBox);
var
i: Integer;
Width, MaxWidth: Integer;
begin
Assert(Assigned(Listbox));
MaxWidth := 0;
for i := 0 to Listbox.Items.Count - 1 do
begin
Width := Listbox.Canvas.TextWidth(Listbox.Items[i]) + 4;
if Width > MaxWidth then
MaxWidth := Width;
end;
if ListBox is TCheckListBox then
Inc(MaxWidth, GetSystemMetrics(SM_CXMENUCHECK) + 2);
SendMessage(Listbox.Handle, LB_SETHORIZONTALEXTENT, MaxWidth, 0);
end;
Zhou JingYu
CnPack Administrator
http://www.cnpack.org/
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-23 07:18
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.008021 second(s), 9 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats