En realidad su uso es sencillo... por ejemplo, un
OpenDialog creado en tiempo de ejecución:
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
var
AFileName: string;
begin
with TOpenDialog.Create(nil) do
try
Filter := 'Archivos de texto|*.txt|Secuencias SQL|*.sql';
Title := 'Abrir archivo';
DefaultExt := '.txt';
InitialDir := 'C:\Archivos de programa';
if Execute then
begin
AFileName := FileName
if FileExists(AFileName) then
with TStringList.Create do
try
LoadFromFile(AFileName)
finally
Free
end
end
finally
Free
end
end;
Ya en tiempo de diseño, puedes establecer algunas otras propiedades más...
Para más información, consulta la ayuda de Delphi...
Saludos...