ImageEn, unit ieopensavedlg

TOpenImageEnDialog.OnCreateCustomControls

TOpenImageEnDialog.OnCreateCustomControls


Declaration

property OnCreateCustomControls: TNotifyEvent;


Description

Occurs immediately before an open/save dialog is executed (shown).

This event is often used to add your own controls to the dialog. You should free custom controls in OnDestroyCustomControls event.


Examples

// Add a checkbox to the Open dialog
var
  MyCbx : TCheckBox;

procedure TForm1.OpenImageEnDialogCreateCustomControls(Sender: TObject);
var
  p: TWinControl;
begin
  p := (sender as TOpenImageEnDialog).InfoPanel;
  MyCbx := TCheckBox.Create(p);
  MyCbx.parent := p;
  MyCbx.Caption := 'Test';
  MyCbx.SetBounds(280, 0, 130, 23);
end;

procedure TForm1.OpenImageEnDialogDestroyCustomControls(Sender: TObject);
begin
  MyCbx.free;
end;


// Uncheck the "Show Preview" checkbox
procedure TForm1.OpenImageEnDialogCreateCustomControls(Sender: TObject);
begin
  (sender as TOpenImageEnDialog).PreviewCheckBox.Checked := False;
end;