Unit UMain;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, OpenDirDialog, StdCtrls, XPMan, ComCtrls;

Type
  TMainForm = Class(TForm)
    TestBtn: TButton;
    ChangeTextBtn: TButton;
    Procedure TestBtnClick(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ChangeTextBtnClick(Sender: TObject);
  Private
    { Private declarations }
  Public
    { Public declarations }
  End;

Var
  MainForm: TMainForm;
  Dlg: TOpenDirDialog;

Implementation

{$R *.dfm}

Procedure TMainForm.TestBtnClick(Sender: TObject);
Begin
  Dlg.Options := [odNewStyle];
  If Dlg.Execute Then
    If Dlg.Path = '' Then
    Case Dlg.Checked Of
      True: MessageBox(Handle, PChar('Флажок установлен!'), 'Информация1', MB_ICONINFORMATION Or MB_OK);
      False: MessageBox(Handle, PChar('Флажок не установлен!'), 'Информация1', MB_ICONINFORMATION Or MB_OK);
    End
    Else
    Case Dlg.Checked Of
      True: MessageBox(Handle, PChar(Dlg.Path + #13#10 + 'Флажок установлен!'), 'Информация', MB_ICONINFORMATION Or MB_OK);
      False: MessageBox(Handle, PChar(Dlg.Path + #13#10 + 'Флажок не установлен!'), 'Информация', MB_ICONINFORMATION Or MB_OK);
    End;  
End;

Procedure TMainForm.FormDestroy(Sender: TObject);
Begin
  Dlg.Free;
End;

Procedure TMainForm.FormCreate(Sender: TObject);
Begin
  Dlg := TOpenDirDialog.Create(handle);
  Dlg.Caption := 'Некоторый текст';
//  Dlg.ShowCheckBox := false;
  Dlg.DefaultChecked := True;
 // Dlg.Options := [odNewStyle];
End;

Procedure TMainForm.ChangeTextBtnClick(Sender: TObject);
Begin
  Dlg.Caption := 'Include subdirectories';
  Dlg.DefaultChecked := False;
  Dlg.Options := [odEditBox];
End;

End.
