[文件管理Samples] TShellComboBox 与 TShellListView 关联问题

boymaster 2004-12-07 09:43:33
我做了一个程序.ShellListView1的ShellComboBox属性设为ShellComboBox1.使两者关联起来.

然后我手工地去设置ShellComboBox1的path属性.修改成功.但ShellListView1不会跟着一块变化关联上.

请教哪位大虾.谢谢~~~在线等待中...
...全文
127 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yeliming 2004-12-28
  • 打赏
  • 举报
回复
有个AutoRefresh属性……你为啥要override之?
李秋步 2004-12-28
  • 打赏
  • 举报
回复
Come on:

ShellLisitView1.autoRfresh:=true;

OK!
boymaster 2004-12-07
  • 打赏
  • 举报
回复
自己顶一下.
alexanda2000 2004-12-07
  • 打赏
  • 举报
回复
刚刚弄了一下,不知道怎么提升方法的可见性了,只好override了一下,呵呵。实现倒是实现了,不过比较的拙劣。

type
TForm1 = class(TForm)
ShellListView1: TShellListView;
Button1: TButton;
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

TMyShellComboBox = class(TCustomShellComboBox) //派生一个子类,用于公开change方法。
published
procedure change;override;
end;

var
Form1: TForm1;
MyShellComboBox:TMyShellComboBox;

implementation

{$R *.dfm}

procedure TMyShellComboBox.Change;
begin
inherited;
end;

procedure TForm1.Button1Click(Sender: TObject);
//改变MyShellComboBox的path后调用change;
begin
with MyShellComBoBox do
begin
path:='c:\';
change;

end;


end;

procedure TForm1.FormCreate(Sender: TObject);
begin
MyShellComboBox:=TmyShellComboBox.Create(self);
with MyShellComboBox do
begin
parent:=self;
left:=32;
top:=16;
height:=22;
width:=361;
shelllistview:=ShellListview1;
end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
MyShellComboBox.Free;
end;

end.
Blakhawk 2004-12-07
  • 打赏
  • 举报
回复
我觉得Borland的这组控件(Shell开头的)开发的真的是差劲,很不好用。
首先:ShellTreeView控件里头没有Directroy属性,虽然有path,但并不能取到
当前选中节点的路径(包含当前节点位置),如:我选到C:\vTmp,应当返回的路径也是C:\vTmp
而它只能通过path取得“c:\”.
其次:ShellListView控件(Report方式)不能取到选择的选定的对象的Caption值。
因为它是从CustomListView继承来的,按道理应当是可以取到对象的Caption值的。
Items[i].Caption,但是这个控件就是取不到。

其他控件我还没有用,不知道是不是不好用,真郁闷。

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧