J
jameschin
Unregistered / Unconfirmed
GUEST, unregistred user!
我用如下代码完成存盘
if form1.SaveDialog1.Execute then
case form1.SaveDialog1.FilterIndex of
1 : begin
form1.RichEdit1.PlainText := true;
form1.SaveDialog1.DefaultExt :='txt' ;
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
2 : begin
form1.RichEdit1.PlainText := false;
form1.SaveDialog1.DefaultExt := 'rtf';
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
3:begin
form1.RichEdit1.PlainText := false;
form1.SaveDialog1.DefaultExt := 'htm';
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
4:begin
form1.RichEdit1.PlainText := false;
form1.SaveDialog1.DefaultExt := 'htlm';
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
end; //存盘完毕
在d4里没问题,在d5里,存盘文件是无类型文件.
if form1.SaveDialog1.Execute then
case form1.SaveDialog1.FilterIndex of
1 : begin
form1.RichEdit1.PlainText := true;
form1.SaveDialog1.DefaultExt :='txt' ;
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
2 : begin
form1.RichEdit1.PlainText := false;
form1.SaveDialog1.DefaultExt := 'rtf';
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
3:begin
form1.RichEdit1.PlainText := false;
form1.SaveDialog1.DefaultExt := 'htm';
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
4:begin
form1.RichEdit1.PlainText := false;
form1.SaveDialog1.DefaultExt := 'htlm';
form1.RichEdit1.Lines.SaveToFile(savedialog1.filename);
end;
end; //存盘完毕
在d4里没问题,在d5里,存盘文件是无类型文件.