我想用TFontDialog 改变字体, 但该对话框 第一次选择不起作用, 要到第二次才行,
我要如何改
谢谢 procedure TForm1.FontDialog1Close(Sender: TObject);
begin
//showmessage('sss');
//sss.Modified := false ;
if sss.Modified = true then
sss.Font := fontdialog1.Font else
begin
sss.Font := fontdialog1.Font ;
sss.Modified := false ;
end ;end;
我要如何改
谢谢 procedure TForm1.FontDialog1Close(Sender: TObject);
begin
//showmessage('sss');
//sss.Modified := false ;
if sss.Modified = true then
sss.Font := fontdialog1.Font else
begin
sss.Font := fontdialog1.Font ;
sss.Modified := false ;
end ;end;
begin
if FontDialog1.Execute then
begin
RichEdit1.Font := FontDialog1.Font;
end;
end;
if FontDialog1.Execute then
begin
//////////
end;
你用if FontDialog1.Execute then就不会有问题了,呵呵
TFontDialog的正确用法就是楼上的。