Minggu, 16 Januari 2011

0

[Delphi] Browse for Folder

  • Minggu, 16 Januari 2011
  • Nurkholish Ardi Firdaus
  • Share
  • Fungsinya sederhana seperti source codenya, yaitu melakukan browsing pada folder lalu menampilkan fullpath dari folder yang sobat click. Coba deh.








    Deklarasi:
    1 Form
    2 Button
    1 Edit

    Source Code:
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, FileCtrl, StdCtrls;
    
    type
      TForm1 = class(TForm)
        Edit1: TEdit;
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure Edit1Change(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      dirFolder: String;
    begin
      if SelectDirectory('Choose a directory','',dirFolder) then
        Edit1.Text:=dirFolder;
    end;
    
    procedure TForm1.Button2Click(Sender: TObject);
    var
      dirFolder: String;
    begin
      if SelectDirectory(dirFolder,[sdAllowCreate,sdPerformCreate,sdPrompt],0) then
        Edit1.Text:=dirFolder;
    end;
    
    procedure TForm1.Edit1Change(Sender: TObject);
    begin
    
    end;
    
    end.
    

    Jangan Lupa Komentar Yaa..
    Related Posts Plugin for WordPress, Blogger...

    0 Komentar Untuk “[Delphi] Browse for Folder”

    Posting Komentar

    Berikan komentar positif tentang artikel yang sederhana ini niscaya sobat akan mendapatkan balasannya. Hehehe

    Subscribe