社区
Delphi
帖子详情
关于FileListBox与DirectroyOutline的问题:
polaris
2000-03-14 02:45:00
关于FileListBox(Win3.1)的问题:
怎样象TREEVIEW的ONEDIT属性一样,来直接修改文件名?
关于DirectroyOutline(Sample):
怎样初始化它的目录?
怎样使它显示隐藏目录和文件?
怎样才能显示+与-,象TREEVIEW的BUTTON属性一样?
...全文
114
3
打赏
收藏
关于FileListBox与DirectroyOutline的问题:
关于FileListBox(Win3.1)的问题: 怎样象TREEVIEW的ONEDIT属性一样,来直接修改文件名? 关于DirectroyOutline(Sample): 怎样初始化它的目录? 怎样使它显示隐藏目录和文件? 怎样才能显示+与-,象TREEVIEW的BUTTON属性一样?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Kingron
2001-05-15
打赏
举报
回复
提问者:如要继续讨论请定期提前贴子,如不想讨论请结束贴子。
musicwind
2001-05-15
打赏
举报
回复
难!
Lin
2000-03-14
打赏
举报
回复
To polaris:
为什么不用新的TreeView和ListView?它们完全可以解决你的问题。
建议:那些组件就别使用了,它们是为了兼容Win3.x而保留的,现在谁还在用Win3.x啊?
至于‘怎样象TREEVIEW的ONEDIT属性一样,来直接修改文件名?’,说来话就长了...
例如要将TreeView和ListView的数据绑定啊,自己枚举绑定后的数据啊...罄竹难书。
建议:看看有关Windows有关Shell扩展的资料。
vb.net drive
listbox
dir
listbox
file
listbox
控件使用
vb.net drive
listbox
dir
listbox
file
listbox
控件使用
delphi7系统文件备份系统
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
File
Ctrl; type TForm1 = class(TForm) DriveComboBox1: TDriveComboBox;
File
ListBox
1: T
File
ListBox
; Directory
ListBox
1: TDirectory
ListBox
; Button1: TButton; Button2: TButton;
ListBox
1: T
ListBox
; Button3: TButton; Button4: TButton; Button5: TButton; Button6: TButton; Edit1: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Edit2: TEdit; Label10: TLabel; Label11: TLabel; Edit3: TEdit; Label12: TLabel; procedure Start(Sender: TObject); procedure changedrive(Sender: TObject); procedure SelectFolder(Sender: TObject); procedure Directory
ListBox
1Change(Sender: TObject); procedure Addit(Sender: TObject); procedure Del(Sender: TObject); procedure Savelist(Sender: TObject); procedure foldercheck(Sender: TObject); procedure Search(Sender: TObject); procedure findlist(sender: TObject); procedure main(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; Bak:string; implementation {$R *.DFM} procedure TForm1.Start(Sender: TObject); {copies
file
s when backup required only replaces ones with newer time date} var dir,newstr,oldstr,s,ss:string; d,f,n,nod,nof,age,bakage,len,lendir,newF:integer; {number of directories ,number of
file
s} a,b:boolean; begin NewF:=0; a:=false; dir:=Directory
ListBox
1.Directory; nod:=
ListBox
1.items.count; for d:=0 to (nod-1) do begin Directory
ListBox
1.Directory:=
listbox
1.items[d];
File
ListBox
1.Directory:=Directory
ListBox
1.Directory; dir:=Directory
ListBox
1.Directory; nof:=
File
ListBox
1.items.count; for f:=0 to (nof-1) do begin oldstr:=Bak; newstr:=dir+'\'+
File
listBox
1.items[f]; lendir:=length(dir); {oldstr:=Bak+'\'+copy(dir,4,len-3);} n:=pos('\',dir); s:=copy(dir,n+1,lendir); n:=pos('\',s); repeat ss:=copy(s,1,n-1); oldstr:=oldstr+'\'+ss; b:=DirectoryExists(oldstr); if b=false then mkdir(oldstr); len:=length(oldstr); s:=copy(dir,len-2,lendir); n:=pos('\',s); until n=0; len:=length(newstr); oldstr:=bak+'\'+copy(newstr,4,len-3); age:=
file
age(newstr); bakage:=
File
age(oldstr); if (age
file(pchar(newstr),pchar(oldstr),a); newF:=newF+1; end; end; end; edit3.text:=inttostr(newF); end; procedure TForm1.changedrive(Sender: TObject); begin Directory
ListBox
1.Drive:=DriveComboBox1.Drive;
File
ListBox
1.Drive:=DriveComboBox1.Drive; end; procedure TForm1.SelectFolder(Sender: TObject); begin
File
ListBox
1.Directory:=Directory
ListBox
1.Directory; end; procedure TForm1.Directory
ListBox
1Change(Sender: TObject); begin
File
ListBox
1.Directory:=Directory
ListBox
1.Directory; end; procedure TForm1.Addit(Sender: TObject); {Adds a folder to the bakup list and saves list - click button when added} begin
ListBox
1.items.Add(Directory
ListBox
1.Directory); Savelist(sender); end; procedure TForm1.Del(Sender: TObject); var n:integer; begin n:=
listbox
1.itemindex;
Listbox
1.items.Delete(n); end; procedure TForm1.Savelist(Sender: TObject); {saves as bakup disk\bakup folder\folderlist.txt to disk the list of folders requiring bakup on } var folderlist:text
file
; n,m:integer; s:string; begin n:=
listbox
1.items.count; assign
file
(folderlist,bak+'\folderlist.txt'); rewrite(folderlist); for m:=0 to (n-1) do begin s:=
listbox
1.items[m]; writeln(folderlist,s); end; close
file
(folderlist); end; procedure TForm1.findlist(sender: TObject); {Finds the list as saved on Disk and loads it at startup} var folderlist:text
file
; s,ss:string; begin Bak:=edit1.text; ss:=bak+'\folderlist.txt'; assign
file
(folderlist,ss{bak+'\folderlist.txt'}); reset(folderlist); repeat readln(folderlist,s);
listbox
1.items.add(s); until (s='eof') or (s=''); close
file
(folderlist); end; procedure TForm1.foldercheck(Sender: TObject); {check folders in
Listbox
and makes ones not already existing} var n,nod,d:integer; s,sFront,sTemp:string; b:boolean; begin nod:=
ListBox
1.items.count; {first see if all folders exist in Bakup folder starting from the top make any not existing - ie sets up the Bakup folder structure} for d:=0 to nod-1 do begin s:=
listbox
1.items[d]; s:=s+'\'; delete(s,1,3); sFront:=Bak; repeat n:=pos('\',s); if n<>0 then begin sTemp:=copy(s,1,n-1); sFront:=sFront+'\'+sTemp; b:=DirectoryExists(sFront); if b=false then MkDir(sFront); Delete(s,1,n); end; until n=0; end; end; procedure TForm1.Search(Sender: TObject); {Takes folder list in
listbox
1 and looks to see if one next level down has new folders. If yes then it makes the new folder and adds it to the
listbox
this enables bakup of new web pages with a Page
File
s folder then saves list Does not seem to add to list box new directories found so that it digs deeper next time appears to add directory tried this saw it in .txt
file
(notpad) but on closing it must save in it original form as it has them gone has this to do with the blank lie that gets added in??????????????????} var nod,numinbox,nn,d,NewDir,len:integer; s,ss,dir:string; b:boolean; begin NewDir:=0; nod:=
ListBox
1.items.count; for d:=0 to nod-1 do begin Directory
ListBox
1.Directory:=
listbox
1.items[d];
File
ListBox
1.Directory:=Directory
ListBox
1.Directory; dir:=Directory
ListBox
1.Directory; numinbox:=directory
ListBox
1.items.count; {top:=directory
ListBox
1.items[0]; top2nd:=directory
ListBox
1.items[1];} for nn:=3 to numinbox-1 do begin s:=
listbox
1.items[d]+'\'+Directory
ListBox
1.items[nn]; b:=DirectoryExists(s); if b=true then begin len:=length(s); ss:=copy(s,4,len); ss:=Bak+'\'+ss; b:=DirectoryExists(ss); if b=false then begin mkdir(ss);
listbox
1.items.add(s); NewDir:=NewDir+1; end; end; end; end; Edit2.text:=inttostr(NewDir); savelist(sender); end; procedure TForm1.main(Sender: TObject); begin findlist(sender); {find list of directories from disk}; foldercheck(sender);{check directories from list exist and if not make them} search(sender); {search for folder one level down} start(sender); {save
file
s if there is a more up to date one} end; end.
Show only Certain Extensions in a
File
ListBox
Show only Certain Extensions in a
File
ListBox
VB图片浏览器(练习
File
Listbox
、Image控件的使用)
VB图片浏览器(练习
File
Listbox
、Image控件的使用) 你所看到的文件来自:E动天下—VB专业源码网
学生上课传输文件系统程序
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
File
Ctrl, IdBaseComponent, ShellApi,IdComponent, IdIPWatch, ExtCtrls, jpeg; type TForm1 = class(TForm)
File
ListBox
1: T
File
ListBox
; Button1: TButton; Directory
ListBox
1: TDirectory
ListBox
; DriveComboBox1: TDriveComboBox; FilterComboBox1: TFilterComboBox; Edit1: TEdit; Label1: TLabel; Button2: TButton; Label2: TLabel; Memo1: TMemo; Label3: TLabel; IdIPWatch1: TIdIPWatch; Label4: TLabel; Button3: TButton; Edit2: TEdit; Label5: TLabel; Label6: TLabel; Label7: TLabel; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure
File
ListBox
1DblClick(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Label3Click(Sender: TObject); procedure Label4Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; a1:integer; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var str5: string; begin begin str5 := InputBox('输入姓名', 'Name:', ''); // Application.Terminate; // 退出程序 if str5 ='' then showmessage('没有输入姓名,请重新输入') else begin ShowMessage(str5); //显示输入的内容 Copy
File
(pchar(string(
File
ListBox
1.
File
Name)), pchar('\\10.10.3.167\stu\' + str5+copy(IdIPWatch1.LocalIP,9,3)+Edit1.text), false); Application.MessageBox('已经复制到老师机子里了', '提示', MB_OK) // Application.Terminate; // 退出程序 end ; end; end; procedure TForm1.FormCreate(Sender: TObject); begin self.
File
ListBox
1.
File
Edit :=self.Edit1 ; self.FilterComboBox1.
File
List :=self.
File
ListBox
1 ; self.Directory
ListBox
1.
File
List :=self.
File
ListBox
1 ; self.Directory
ListBox
1.DirLabel :=self.Label1 ; self.DriveComboBox1.DirList :=self.Directory
ListBox
1 ; self.Button1.Default :=true; self.Button3.Visible :=false; end; procedure TForm1.
File
ListBox
1DblClick(Sender: TObject); begin // Copy
File
(
File
ListBox
1.
File
Name,
File
ListBox
1.
File
Name,False); //Copy
File
(pchar(string(
File
ListBox
1.
File
Name)), pchar('\\10.10.3.167\stu\' +copy(IdIPWatch1.LocalIP,9,3)+ Edit1.text), false); //Application.MessageBox('已经复制到老师机子里了', '提示', MB_OK) ShellExecute(handle,'open', pchar(string(
File
ListBox
1.
File
Name)), nil, nil, SW_SHOWNORMAL); end; procedure TForm1.Button2Click(Sender: TObject); begin Application.Terminate; // 退出程序 end; procedure TForm1.Label3Click(Sender: TObject); begin memo1.
Line
s.LoadFrom
File
(getcurrentdir+'\a.txt'); end; procedure TForm1.Label4Click(Sender: TObject); begin memo1.
Line
s.LoadFrom
File
(getcurrentdir+'\a1.txt'); end; procedure TForm1.Button3Click(Sender: TObject); var str6: string; begin begin str6 := InputBox('输入窗口标题', '输入提示', '默认输入内容'); ShowMessage(str6); //显示输入的内容 memo1.
Line
s.SaveTo
File
('\\10.10.3.167\stu\' + copy(IdIPWatch1.LocalIP,9,3)+str6+'.txt'); Application.MessageBox('你的作业已经复制到老师机子里了', '提示', MB_OK) end; end; end.
Delphi
5,392
社区成员
262,731
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章