怎么建立‘Windows 资源管理器’

风子 2000-03-27 09:28:00
怎么建立像Windows资源管理器那样左边是目录(包括盘符、目录,反正就是Windows 资源管理器那样),右边是文件或目录的窗口?好像BCB的控件都是盘符、目录、文件分开的,CDirectoryOutline也是目录和文件列表。
...全文
269 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaocaocao 2000-04-27
  • 打赏
  • 举报
回复
sorry,sorry,不小心多按了几下按钮
xiaocaocao 2000-04-27
  • 打赏
  • 举报
回复
就用CB的控件很容易实现资源管理其的功能,
要添加的代码极其之少.
Wingsun 2000-03-29
  • 打赏
  • 举报
回复
如果你要实现的是Explorer的功能,就要调用Windows SHELL功能。具体可以查阅MSDN的帮助
Firing_Sky 2000-03-29
  • 打赏
  • 举报
回复
左边一个TreeView,右边一个ListView
有3个函数可用:FindFirst、FindNext、FindClose
它们的用法帮助里面有,一个例子如下
void __fastcall TForm1::Button1Click(TObject *Sender)

{
TSearchRec sr;
int iAttributes = 0;
StringGrid1->RowCount = 1;
iAttributes and = faReadOnly * CheckBox1->Checked and faHidden * CheckBox2->Checked and faSysFile * CheckBox3->Checked and faVolumeID * CheckBox4->Checked and faDirectory * CheckBox5->Checked and faArchive * CheckBox6->Checked and faAnyFile * CheckBox7->Checked;

if (FindFirst(Edit1->Text, iAttributes, sr) == 0)
{
if (sr.Attr == iAttributes)
{
StringGrid1->Cells[1][StringGrid1->RowCount-1]
= sr.Name;

StringGrid1->Cells[2][StringGrid1->RowCount-1]
= IntToStr(sr.Size);
}
while (FindNext(sr) == 0)
{
if (sr.Attr == iAttributes)
{
StringGrid1->RowCount = StringGrid1->RowCount + 1;
StringGrid1->Cells[1][StringGrid1->RowCount-1]
= sr.Name;
StringGrid1->Cells[2][StringGrid1->RowCount-1]
= IntToStr(sr.Size);
}
}
FindClose(sr);
}
}
风子 2000-03-29
  • 打赏
  • 举报
回复
我想取得选定的文件或目录名
kxy 2000-03-28
  • 打赏
  • 举报
回复
去网上找找,这种控件很多。delphi的更多。
风子 2000-03-28
  • 打赏
  • 举报
回复
但是,用TreeView和ListView具体怎么做?
Wingsun 2000-03-27
  • 打赏
  • 举报
回复
TreeView和ListView,TreeView列出目录,ListView列出文件或目录。中间在加一个Splliter既可以调节大小。
Shania 2000-03-27
  • 打赏
  • 举报
回复
如果你用Visual C++ 6.0的话,事情就非常简单,在App Wizard的第5步,如果你选择了Windows Explorer 的风格,那么生成的工程就是你要的那种。
否则,左边TTreeView,右边TListView.
olo 2000-03-27
  • 打赏
  • 举报
回复
Treeview和ListView

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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