u can the following method: var UseItalic,UseBold:Boolean; // if fsItalic in memo1.font.style then UseItalic:=true else UseItalic:=false; if fsBold in memo1.font.style then UseBold:=true else UseBold:=false; // later u can write UseItalic,UseBold to a inifile next time read them. // var UseStyle:TFontStyle; if UseItalic then UseStyle=[fsItalic]; if UseBold then UseStyle=[fsBold]; if UseItaLic and UseBold then UseStyle=[fsItalic,fsBold]; // and so on
只能自己处理同意 darkness
firing_sky 是对的,可以把字体风格的枚类型转换为了整数值保存。
u can the following method: var UseItalic,UseBold,UseUnderline,,UseStikeOut:Boolean; // if fsItalic in memo1.font.style then UseItalic:=true else UseItalic:=false; if fsBold in memo1.font.style then UseBold:=true else UseBold:=false; if fsUnderline in memo1.font.style then UseUnderLine:=true else UseUnderLine:=false if fsStrikeout in memo1.font.style then UseStrikeOut:=true else UseStikeOut:=false // later u can write UseItalic,UseBold to a inifile next time read them. // var UseStyle:TFontStyle; UseStyle:=[]; if UseItalic then UseStyle:=[fsItalic]; if UseBold then UseStyle:=UseStyle+[fsBold]; if UseUnderLine then UseStyle:=UseStyle+[fsUnderLine]; if UseStrikeOut then UseStyle:=UseStyle+[fsStikeOut]; // and so on
var UseItalic,UseBold:Boolean;
//
if fsItalic in memo1.font.style then UseItalic:=true
else UseItalic:=false;
if fsBold in memo1.font.style then UseBold:=true
else UseBold:=false;
//
later u can write UseItalic,UseBold to a inifile
next time read them.
//
var UseStyle:TFontStyle;
if UseItalic then UseStyle=[fsItalic];
if UseBold then UseStyle=[fsBold];
if UseItaLic and UseBold then UseStyle=[fsItalic,fsBold];
//
and so on
var UseItalic,UseBold,UseUnderline,,UseStikeOut:Boolean;
//
if fsItalic in memo1.font.style then UseItalic:=true
else UseItalic:=false;
if fsBold in memo1.font.style then UseBold:=true
else UseBold:=false;
if fsUnderline in memo1.font.style then UseUnderLine:=true
else UseUnderLine:=false
if fsStrikeout in memo1.font.style then UseStrikeOut:=true
else UseStikeOut:=false
//
later u can write UseItalic,UseBold to a inifile
next time read them.
//
var UseStyle:TFontStyle;
UseStyle:=[];
if UseItalic then UseStyle:=[fsItalic];
if UseBold then UseStyle:=UseStyle+[fsBold];
if UseUnderLine then UseStyle:=UseStyle+[fsUnderLine];
if UseStrikeOut then UseStyle:=UseStyle+[fsStikeOut];
//
and so on