delphi listbox用Canvas属性绘图
2022-11-22 10:51:08 作者:admin
本文整理自网络,侵删。
示例 delphi listbox用Canvas属性绘图procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);var i:integer;begin with Control as TListBox do begin Canvas.FrameRect(Clientrect); if odSelected in State then begin Canvas.Brush.Color:=clRed; Canvas.RoundRect(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom,8,15); setBkMode(Canvas.Handle,TRANSPARENT ); Canvas.TextOut((Rect.right-Rect.Left) div 2,Rect.Top,Items.Strings[Index]); end else begin Canvas.Brush.Color:=clSkyBlue; Canvas.RoundRect(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom,15,15); Canvas.TextRect(Rect,Rect.Left,Rect.Top,Items.Strings[Index]); end; end;end;
相关阅读 >>
Delphi 判断文件名是否有效
Delphi getsys32path()得到系统system32路径
Delphi firedac 获取mysql 数据库databases 列表
Delphi superobject 序列数据集
Delphi xe 自己编辑xe2 vcl style(皮肤/skin)
Delphi xe中windows7新的taskbar功能的使用
Delphi写的验证身份证号有效性函数
Delphi xe2 - 实现主窗口在任务栏上不显示
Delphi 数组与子界
Delphi 在 webservice 中采用 tsoapattachment 传输文件
更多相关阅读请进入《Delphi》频道 >>
猜你喜欢
联络方式:
400-123-789
邮箱:xiachao@163.com
Q Q:12345678
微信公众号
微信二维码
