listview可不可以有背景图片,可以有的话,怎么弄!listview里的item可不可以响应双击事件,是在ondblclick事件里写的吗?可以的话,给点源码
解决方案 »
- delphi+mscomm串口通信,发送数据帧后,怎样获取返回值?请大家指点。。。
- 用sqlQuery查询oracle数据库中内容,怎样获取查询的总记录数呢????
- 关于socket的问题!
- 一个着急的问题,精通fastreport的同学救命啊!
- 有关调用DLL内的Frame做为主调程序某容器(如Panel)的内容的问题,求高手帮忙
- 将excel表数据拖拉到stringgrid中
- InstallShield Developer(7.04)的Sn!!!!
- 谁能告诉我Delphi6.0中文版的下载地址,300分赠送
- 关于调用C++编写的DLL的问题,急急急!
- 流操作出错??
- 商业胜手报表和查询用的什么控件?超市mis/pos问题
- 怎样打印屏幕?(希望是代码!)
procedure Tform_GCZL.TreeView_mainClick(Sender: TObject);
var
mystr:string;
mystream:TMemoryStream;
begin
if TreeView_main.Selected=nil then Exit;
if TreeView_main.Selected.AbsoluteIndex=0 then Exit;
if (TreeView_main.Selected.ImageIndex=1) or (TreeView_main.Selected.ImageIndex=2) then
begin
if OleContainer_sys.State<>osEmpty then
begin
OleContainer_sys.DestroyObject;
Exit;
end;
end;
Screen.Cursor:=crHourGlass;
//saveole;
mystr:=getBG_ID(TreeView_main.Selected.AbsoluteIndex);
with myadoq do
begin
Close;
SQL.Clear;
SQL.Add('select * from mulu_file where BG_ID='''+mystr+''' and isfile=1');
Open;
if RecordCount>0 then
begin
mystream:=TMemoryStream.Create;
TBlobField(Fieldbyname('BG_FILE')).SaveToStream(mystream);
mystream.Position:=0;
OleContainer_sys.LoadFromStream(mystream);
Screen.Cursor:=crDefault;
end;
end;
Screen.Cursor:=crDefault;
end;
---------------
可以的,自己画
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.
procedure TForm1.ListView4DblClick(Sender: TObject);
begin
if ListView4.Selected=nil then exit;
case ListView4.Items.IndexOf(ListView4.Selected) of
0:Label8.Caption:=ListView4.Selected.Caption;
1:Label8.Caption:=ListView4.Selected.Caption;
2:Label8.Caption:=ListView4.Selected.Caption;
3:Label8.Caption:=ListView4.Selected.Caption;
4:Label8.Caption:=ListView4.Selected.Caption;
end;
end;
贴子:http://community.csdn.net/Expert/topic/3335/3335955.xml?temp=.9686701