procedure TForm1.ShellListView1Change(Sender: TObject; Item: TListItem;
Change: TItemChange);
begin
aFile:=ShellListView1.Folders[ShellListView1.Selected.Index].PathName;
StringGrid1.Cells[2,1]:=aFile;
end;
选择第一个文件的时候可以正常显示,再选择另外一个文件就会出错,提示什么地址读取错误。是边界出错吗?求教!
Change: TItemChange);
begin
aFile:=ShellListView1.Folders[ShellListView1.Selected.Index].PathName;
StringGrid1.Cells[2,1]:=aFile;
end;
选择第一个文件的时候可以正常显示,再选择另外一个文件就会出错,提示什么地址读取错误。是边界出错吗?求教!
你的位置是不是应该改变一下啊!
怎么还是StringGrid1.Cells[2,1]:呢!
不懂!
StringGrid1.Cells[2,1]:=aFile;就是把文件名输出到一个cell去
我的目的是在ShellListView选择不同文件获得文件名(包括单击、键盘选择)。
我用下面代码的时候选择文件的时候会出错:access violation at address ……
procedure TForm1.ShellListView1Change(Sender: TObject; Item: TListItem;
Change: TItemChange);
var aFile:string;
begin
aFile:=ShellListView1.Folders[ShellListView1.Selected.Index].PathName;
StringGrid1.Cells[2,1]:=aFile;
end;
真弄不明白,大家帮帮忙吧。
if shellListView.ItemIndex < 0 then exit;应该写到哪里呢?
他们的autorefresh设成ture,运行的时候点击一些目录会的时候会有内存调用出错!具体原因还未清楚。有那微笑地给我介绍一些类似TShellTreeView、TShellListViewd国内的vcl?
当然要能在非英文windows系统顺利运行的!谢谢!
当然要能在非英文windows系统顺利运行的!谢谢!
OnClick里第一步要判断
if ShellListView1.Selected = nil then
exit;
困扰我很久的问题居然给你解决了,不过菜菜的我还是不很明白,你那句是什么意思?borland的技术支持怎么没想到?他们怎么说是在英文windows就没问题呢?
Boland提供的标准ListView也没有此判断,需要自己加上去
微软的ListView6.0自己有个判断
procedure TForm1.ShellListView1DblClick(Sender: TObject);
begin
if ShellListView1.Selected = nil then exit;
end;
我想知道解决方法,可以把你的demo给我吗?[email protected]
要不我就要去找控件了,还不知道哪里有
Delphi7+Win2Kpro
很感谢你的demo,但是不太合我要求。
我的意思是:
TShellTreeView、TShellListViewd同时存在,他们的autorefresh都设成ture,才会运行的时候点击一些目录会的时候会出错!
而不是只有一个TShellListView。
谢谢你的帮忙,可能在帮我想一想吗?应该机会很微了。