须要个类似资料经管器的器材, 起首试了下 TDriveComboBox、TDirectoryListBox、TFileListBox, 嘿! Win3.1 时代的器材, 不是一般地丑.
试了下 Vcl.Shell.ShellCtrls 下的 TShellComboBox、TShellTreeView、TShellListView, 很是合意! 并且 TShellComboBox 也可以免掉了.
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.FileCtrl, Vcl.StdCtrls,
Vcl.ComCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
procedure TreeViewOnChange(Sender: TObject; Node: TTreeNode);
public
end;
var
Form1: TForm1;
implementation
{¥R .dfm}
uses Vcl.Shell.ShellCtrls;
var
C: TShellComboBox;
T: TShellTreeView;
L: TShellListView;
procedure TForm1.FormCreate(Sender: TObject);
begin
C := TShellComboBox.Create(Self);
T := TShellTreeView.Create(Self);
L := TShellListView.Create(Self);
C.Parent := Self;
T.Parent := Self;
L.Parent := Self;
T.Width := Screen.Width div 4;
C.Align := alTop;
T.Align := alLeft;
L.Align := alClient;
T.ShellComboBox := C;
L.ShellTreeView := T;
L.ViewStyle := vsList;
T.OnChange := TreeViewOnChange;
end;
procedure TForm1.TreeViewOnChange(Sender: TObject; Node: TTreeNode);
begin
Caption := T.SelectedFolder.PathName;
end;
end.
彼此相爱,却不要让爱成了束缚:不如让它成为涌动的大海,两岸乃是你们的灵魂。互斟满杯,却不要同饮一杯。相赠面包,却不要共食一个。一起歌舞欢喜,却依然各自独立,相互交心,却不是让对方收藏。因为唯有生命之手,方能收容你们的心。站在一起却不要过于靠近。—— 纪伯伦《先知》