求listview ,能放底图 (100分)

  • 主题发起人 主题发起人 边城
  • 开始时间 开始时间

边城

Unregistered / Unconfirmed
GUEST, unregistred user!
用过PCANYWHERE 的朋友就知道,
它下面的主界面LISTVIEW里,右下角有一小图,(里有HOST字样)
我就要那效果。
 
在OnCustomeDraw里,你想怎么画都行
 
unit ListViewMain;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics,
Controls, Forms, Dialogs,
ComCtrls, ImgList;
type
TForm1 = class(TForm)
ListView1: TListView;
ImageList1: TImageList;
procedure ListView1CustomDraw(Sender:
TCustomListView;
const ARect: TRect; var DefaultDraw:
Boolean);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Bitmap1: TBitmap;
implementation
{$R *.DFM}

procedure TForm1.ListView1CustomDraw(Sender:
TCustomListView;
const ARect: TRect; var DefaultDraw: Boolean);
var
x,y,w,h : LongInt;
begin
with Bitmap1 do begin
W := Width;
H := Height;
end;
Y := 0;
while Y < Height do begin
X := 0;
while X < Width do begin
ListView1.Canvas.Draw(X, Y, Bitmap1);
Inc(X, W);
end;
Inc(Y, H);
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Bitmap1 := TBitmap.Create;
Bitmap1.LoadFromFile('backgray.bmp');
end;

procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Bitmap1.Free;
end;

end.
 

Similar threads

回复
0
查看
1K
不得闲
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
866
DelphiTeacher的专栏
D
后退
顶部