是这样的,我用NMFTP控件做了一个上传的小程序,与服务器连接后用ListBox显示服务器上的文件列表,但是显示出来后文件和文件夹不太好区分,我想用图片区分文件和文件夹(象CuteFtp那样),有什么办法吗?????
解决方案 »
- QRSubDetail 托到QRBand怎么看不见?
- 复制列 到另一个表
- 看到一个奇怪的问题:关于length()的返回值
- 把delphi代码编译成dll
- 用ADO的方式访问数据库怎么才能在提交数据后即时查询到该记录啊?
- 如何在一个彩色相片的一个角上套印一个红色印章?
- 怎样将使用复制命令复制到dbMemo中的数据更新到数据库?
- 按下up,或down,怎样得到下一个的itemindex.
- 找圆角边的按钮控件,效果类似FlatStyle的FlatButton(可惜不能设置圆角),谢谢。高分!先到先得~~~
- 在DBGride里我怎样把一个int型的字段显示成 "0000123"的类型?
- 我还有话要说!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 请问如何判断Excel2000已经启动?
1、首先先将文件夹及文件图标载入到ImageList中。
2、在列出Ftp文件列表时,根据是文件夹还是文件,生成FolderArray
3、在ListBox的OnDrawItem写入代码。
procedure TFrmListBoxTest.LBTestDrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
var tmpBmp:TBitmap;
ImgIndex :integer;
DrawX,DrawY:integer;
begin
tmpBmp :=TBitmap.Create();
{ FolderArray为动态数组,可在列出文件时生成的标 }
{ 此处为取该图标在ImageList的位置 }
ImgIndex :=FolderArray[Index]
IMGLst.GetBitmap(ImgIndex,tmpBmp);
DrawX :=3;
DrawY :=Rect.Top+Round(((Rect.Bottom-Rect.Top)-tmpBmp.Height)/2);
if (odFocused in State) then
begin
{ 聚焦时的重画事件 }
with LBTest.Canvas do
begin
Brush.Style :=bsSolid;
Brush.Color :=RGB(129,154,204);
//FillRect(Rect);
Pen.Color :=clBlack;
RoundRect(Rect.Left,Rect.Top,Rect.Right,Rect.Bottom,4,4);
Draw(DrawX-1,DrawY-1,tmpBmp);
Brush.Style :=bsClear;
Rectangle(DrawX-1,DrawY-1,DrawX+tmpBmp.Width-1,DrawY+tmpBmp.Height-1);
DrawFocusRect(Rect);
end;
end
else begin
{ 非聚焦时的重画事件 }
with LBTest.Canvas do
begin
Brush.Style :=bsSolid;
Brush.Color :=clWhite;
FillRect(Rect);
Pen.Color :=clBlack;
Brush.Style :=bsClear;
Rectangle(DrawX,DrawY,DrawX+tmpBmp.Width,DrawY+tmpBmp.Height);
Draw(DrawX,DrawY,tmpBmp);
end;
end;
tmpBmp.Free();
end;