unit1.pas

来自「Delphi7编程80例(完全版)」· PAS 代码 · 共 41 行

PAS
41
字号
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, ShellCtrls;

type
  TForm1 = class(TForm)
    ShellTreeView1: TShellTreeView;
    ShellComboBox1: TShellComboBox;
    ShellListView1: TShellListView;
    Label1: TLabel;
    ComboBox1: TComboBox;
    procedure ComboBox1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  case ComboBox1.ItemIndex of
    0: ShellListView1.ViewStyle := vsList; //列表
    1: ShellListView1.ViewStyle := vsIcon; //大图标
    2: ShellListView1.ViewStyle := vsSmallIcon; //小图标
    3: ShellListView1.ViewStyle := vsReport; // 详细资料
  end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?