procedure TForm1.S1Click(Sender: TObject);
var
A:TTextAttributes;
begin
A.Create(Memo1,atSelected);
try
if FontDialog1.Execute then begin
with FontDialog1.Font do begin
A.Color:=Color;
A.Height:=Height;
A.Name:=Name;
A.Pitch:=Pitch;
A.Size:=Size;
A.Style:=Style;
end;
Memo1.SelAttributes:=TTextAttributes(A);
end;
finally
A.Free;
end;
end;
を実行しても、
EConvertError クラスの例外を生成しました。'TMenuItem を TTextAttributes に代入することはできません'というエラーが発生して、
EAccessViolation クラスの例外を生成しました。というエラーも発生して、
ポップアップメニューからそのメニューアイテムが消えてしまいます。
どなたか教えてくださいませんか?
ちなみにD5EnterPriseUP1+XPProSP2を使っています。
自己解決しました。
ツイート | ![]() |