type
TForm1 = class(TForm)
RichEdit1: TRichEdit;
SaveDialog1: TSaveDialog;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
fname : String;
begin
if SaveDialog1.Execute then
begin
case SaveDialog1.FilterIndex of
1: fname := SaveDialog1.FileName + '.rtf';
2: fname := SaveDialog1.FileName + '.txt';
end;
// 加入对 fname 的处理
end;