如何把memo的字体信息存入INI中

hamsoft 2000-01-15 10:39:00
我在开发中,碰到有把memo的字体信息存入INI中,字号和大小好解决,但stype不好解决,如斜体等。
...全文
398 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Venne 2000-01-16
  • 打赏
  • 举报
回复
firing_sky 是对的,可以把字体风格的枚类型转换为了整数值保存。
Firing_Sky 2000-01-16
  • 打赏
  • 举报
回复
用ord函数转换序数列
darkness 2000-01-16
  • 打赏
  • 举报
回复
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



LaoZheng 2000-01-16
  • 打赏
  • 举报
回复
只能自己处理同意 darkness
darkness 2000-01-15
  • 打赏
  • 举报
回复
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


渤海海峡 2000-01-15
  • 打赏
  • 举报
回复
做一些转换不就可以了吗?
如:
style=1 (或,2,3,4 等)
然后在程序中在转换回来。
另外:对于style这样的属性应该是一个序数列,因此按整数存是有道理的。

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧