用Delphi仿寫的Windows資源管理器,可排列圖標,改變查看方式,左側樹控菜單,和Windows文件管理器是一樣的效果,更重要的是代碼簡單,如果你是Delphi初學者,那就更不要錯過哦,現在發代碼:
01
unit Unit1;
02
interface
03
uses
04
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
05
Dialogs, StdCtrls, ComCtrls, ShellCtrls;
06
type
07
TForm1 = class(TForm)
08
ShellTreeView1: TShellTreeVIEw;
09
ShellComboBox1: TShellComboBox;
10
ShellListView1: TShellListVIEw;
11
Label1: TLabel;
12
ComboBox1: TComboBox;
13
procedure ComboBox1Change(Sender: TObject);
14
private
15
{ Private declarations }
16
public
17
{ Public declarations }
18
end;
19
var
20
Form1: TForm1;
21
implementation
22
{$R *.dfm}
23
procedure TForm1.ComboBox1Change(Sender: TObject);
24
begin
25
case ComboBox1.ItemIndex of
26
0: ShellListVIEw1.VIEwStyle := vsList; //列表
27
1: ShellListVIEw1.VIEwStyle := vsIcon; //大圖標
28
2: ShellListVIEw1.VIEwStyle := vsSmallIcon; //小圖標
29
3: ShellListVIEw1.VIEwStyle := vsReport; // 詳細資料
30
end;
31
end;
32
end.
Delphi資源管理器源代碼運行圖:
