摘要载入中… 请稍等…
内容载入中… 请稍等…
| ◎→ | 本类最新 |
|
在DELPHI中用线程排序 在Delphi中使用Queued Component 作非常规程序菜单掌握delphi 执行一个外部程序并等待它的完成 在应用程序中跟踪MOUSE的坐标 五子棋源代码 显示密码的原理 |
|
| ◎→相关资源 | |
| C语言入门视频教程 C#编程WinForm入门视频 Asp.net入门视频教程下载 VC++编程视频教程下载 VB窗体文章 HTML入门教程 Deiphi实例教程 Deiphi窗体文章 Deiphi数据库编程 Deiphi网络编程 Deiphi图形图象文章 Deiphi系统文件 | |
| ◎→ | 热门资源 |
| Listview中实现点击栏目标题排序 Microsoft Agent技术在Delphi中的 MIDAS中动态强制约束编程 Chuck Jazdzewski的离开意味着De COM程序编写入门(三) DELPHI中利用对象的常用属性制作 Delphi中巧妙利用RES文件 |
|
unit unit1;
interface
uses
windows, messages, sysutils, classes, graphics, controls, forms, dialogs,
stdctrls;
type
tform1 = class(tform)
list1: tcombobox;
button1: tbutton;
procedure button1click(sender: tobject);
procedure formcreate(sender: tobject);
procedure list1drawitem(control: twincontrol; index: integer;
rect: trect; state: townerdrawstate);
private
{ private declarations }
public
{ public declarations }
end;
var
form1: tform1;
implementation
{$r *.dfm}
procedure tform1.button1click(sender: tobject);
var
s: string;
begin
randomize;
s:= inttostr(random(100));//last here!
createdir(s);
end;
procedure tform1.formcreate(sender: tobject);
var
bit1,bit2,bit3,bit4,bit5,bit6: tbitmap;
begin
list1.style := csownerdrawvariable;
list1.itemheight := 30;
bit1 := tbitmap.create;
bit1.loadfromfile('c:\program files\oicq\face\1-1.bmp');
bit2 := tbitmap.create;
bit2.loadfromfile('c:\program files\oicq\face\2-1.bmp');
bit3 := tbitmap.create;
bit3.loadfromfile('c:\program files\oicq\face\3-1.bmp');
bit4 := tbitmap.create;
bit4.loadfromfile('c:\program files\oicq\face\4-1.bmp');
bit5 := tbitmap.create;
bit5.loadfromfile('c:\program files\oicq\face\5-1.bmp');
bit6 := tbitmap.create;
bit6.loadfromfile('c:\program files\oicq\face\6-1.bmp');
list1.items.addobject('图标1',bit1);
list1.items.addobject('图标2',bit2);
list1.items.addobject('图标3', bit3);
list1.items.addobject('图标4', bit4);
list1.items.addobject('图标5', bit5);
list1.items.addobject('图标6', bit6);
list1.itemindex :=0;
end;
procedure tform1.list1drawitem(control: twincontrol; index: integer;
rect: trect; state: townerdrawstate);
var
bitmap: tbitmap;
offset: integer;
begin
with(control as tcombobox).canvas do
begin
fillrect(rect);
bitmap := tbitmap(list1.items.objects[index]);
//bitmap := tbitmap.create;
//imagelist1.getbitmap(index,bitmap);
if bitmap<> nil then
begin
brushcopy(bounds(rect.left+2,rect.top+2,bitmap.width,bitmap.height),bitmap,
bounds(0,0,bitmap.width,bitmap.height),clred);
offset := bitmap.width + 8;
textout(rect.left+offset,rect.top,list1.items[index]);
end;
end;
end;
end.
| 芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 |