delphi tlistbox添加横向滚动条


本文整理自网络,侵删。

 
procedure TForm1.SetWidth(pListBox:TListBox);
var
  i, w: Integer;
begin
  w := 0;


  for i := 0 to pListBox.Items.Count - 1 do
  begin
    Canvas.Font.Name := pListBox.Font.Name;
    Canvas.Font.Size := pListBox.Font.Size;
    if Canvas.TextWidth(pListBox.Items[i]) > w then
    w := Canvas.TextWidth(pListBox.Items[i]);
  end;
  SendMessage(pListBox.Handle, LB_SETHORIZONTALEXTENT, w + 10, 0);
end;

――――――――――――――――

原文链接:https://blog.csdn.net/ozhy111/article/details/80940868

相关阅读 >>

Delphi学习sql语句 - insert、update、delete

Delphi取得网页源码内容

Delphi getwebbrowserhtml 获取网页源代码

Delphi实现变速齿轮

Delphi - system.runerror

Delphi 监控系统文件操作

Delphi 网络时间校对

Delphi提取字符串

Delphi-改进获取文件md5 hash方法

Delphi中使用词霸2005的动态库xdictgrb.dll实现屏幕取词

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...