我做了一個例子,但我還想知道有那些更好的方法
procedure TForm1.CheckListBox1DrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
Bitmap.LoadFromFile('c:\ddd.bmp'); CheckListBox1.Canvas.TextRect(Rect,Rect.TopLeft.X+30,Rect.BottomRight.y-15,CheckListBox1.Items.Strings[Index]);
CheckListBox1.Canvas.Draw(Rect.TopLeft.X,Rect.BottomRight.y-15, Bitmap);
end;
procedure TForm1.CheckListBox1DrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
Bitmap.LoadFromFile('c:\ddd.bmp'); CheckListBox1.Canvas.TextRect(Rect,Rect.TopLeft.X+30,Rect.BottomRight.y-15,CheckListBox1.Items.Strings[Index]);
CheckListBox1.Canvas.Draw(Rect.TopLeft.X,Rect.BottomRight.y-15, Bitmap);
end;
解决方案 »
- 使用D7进行Activex开发中,方法或过程在TYPE LIB中如何设置?
- delphi button上添加bmp图片 怎样将其中的底色透明
- 最近 我研究 搜索引擎 (四) 中英文混合分词 V1.0正式发布(可下载)
- Database(BDE)+Table+DataSetProvider+ClientDataSet+DataSource+DBGrid遇到的问题
- 如何不让光驱手动开
- 最愚笨的问题
- !!!急,十万火急!!!
- 我怎么让Combox不能选择?
- 一个定时调用PING.exe的程序中,如何在等待的时候少占或不占CPU??急!!!!!!
- 大家有谁用UML和delphi做过项目,说说体会,怎么运作的?
- 在SQLSERVER中数据库字段用中文命名有什么问题?
- RMB2K游戏制作大赛
如果要用的话,d7里面有个现成的
Additional\ColorBox
因为 Delphi 就是这样的工具