Delphi VJ VB VC 討論 聯繫 首頁
DELPHI參考文件

 單元架構元件
 Pascal語言元件
 Standard元件
 Additional元件
 Win31元件
 Win32元件
 Dialog元件
 Dialog範例
 資料庫(上)
 資料庫(中)
 資料庫(下)
 報表製作
 鍵盤資料(上)
 鍵盤資料(中)
 鍵盤資料(下)

作品介紹

免費下載

廠商軟體


Win3.1元件頁

圖示

名稱

說明

Header

提供標題元件

FileListBox

檔案清單元件

DirectoryListBox

目錄清單元件

DriveComboBox

磁碟選擇方塊

FilterComboBox

檔案過濾器選擇元件

OutLine

階層式顯示資料元件


push-flower.gif (2012 bytes)樹枝狀結構目錄(使用OutLine)

sun.gif (1868 bytes)加入元件改變屬性值
sun.gif (1868 bytes)程式寫作

implementation
{$R *.DFM}

Var//宣告變數用來記錄所選取的項目位置Pos:Integer;

procedure TForm1.Button3Click(Sender: TObject);
begin
//新增第一層
Outline1.Add(Pos,Edit1.Text)
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
//新增次層
OutLine1.AddChild(Pos,Edit1.Text);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
//插入項目
OutLine1.Insert(Pos,Edit1.Text);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
//刪除項目
OutLine1.Delete(Pos);
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
//將建立好的資料儲存起來OutLine1.Lines.SaveToFile('C:\Test.Txt');
end;

procedure TForm1.Outline1Click(Sender: TObject);
begin
//記錄項目位置
Pos:=OutLine1.SelectedItem;
end;

end.


push-flower.gif (2012 bytes)可執行程式的檔案總管

sun.gif (1868 bytes)Hander元件需利用【Section】屬性來編輯標題
sun.gif (1868 bytes)FileComboBox的【FileList】屬性必須指定給FileListBox
sun.gif (1868 bytes)利用GileComboBox的【Filter】屬性來設定要過濾的檔案類型
sun.gif (1868 bytes)
執行程式的指令為WinExec(檔名,參數),檔名必須是Pchar型式

implementation
{$R *.DFM}

procedure TForm1.DirectoryListBox1Change(Sender: TObject);
begin
//改變目錄位置時更新檔案列表
FileListBox1.Directory:=DirectoryListBox1.Directory;
end;

procedure TForm1.DriveComboBox1Change(Sender: TObject);
begin
//改變磁碟位置時,更新目錄列表DirectoryListBox1.Drive:=DriveComboBox1.Drive;
end;

//執行選取的檔案
procedure TForm1.Button1Click(Sender: TObject);
Var
FName:PChar;
begin
FName:=StrAlloc(256);
FName:=StrPCopy(FName,FileListBox1.FileName);
WinExec(FName,1);
end;

end.


本網頁由昱得資訊工作室製作(C) Copyright Valor-Station since in 1993

 

本網站全部內容係屬【昱得資訊工作室】版權所有,轉載必究,
非經正式書面同意,不得將全部或部分內容,以任何方式轉載於其他網站或用於任何商業行為