DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: snarv
今日帖子: 11
在线用户: 15
导航: 论坛 -> 数据库专区 斑竹:liumazi,waterstone  
作者:
男 fdonne (fdonne) ★☆☆☆☆ -
盒子活跃会员
2004/4/27 9:54:57
标题:
[求助]如何把Font的Pitch和Style属性用数据库保存和打开 浏览:1426
加入我的收藏
楼主: 同题,谢谢
----------------------------------------------
-
作者:
男 sephil (NAILY Soft) ★☆☆☆☆ -
盒子中级会员
2004/4/27 10:07:55
1楼: 对于TFontPitch可以将其值转换为整形,象Ord(fpDefault)
用TFontPitch(0)这样的方法转换回来

var
  I: Integer;
begin
  I := Ord(Form1.Font.Pitch);
  Form1.Font.Pitch := TFontPitch(I);
end;

对于FontStyle就稍微复杂点
var
  I: Integer;
begin
  // Save font style
  I := 0;
  if fsBold in Form1.Font.Style then I := I or 1;
  if fsItalic in Form1.Font.Style then I := I or 2;
  if fsUnderline in Form1.Font.Style then I := I or 4;
  if fsStrikeOut in Form1.Font.Style then I := I or 8;

  // Load font style
  if I and 1 = 1 then Form1.Font.Style := Form1.Font.Style + [fsBold]
  else Form1.Font.Style := Form1.Font.Style - [fsBold];
  if I and 2 = 2 then Form1.Font.Style := Form1.Font.Style + [fsItalic]
  else Form1.Font.Style := Form1.Font.Style - [fsItalic];
  if I and 4 = 4 then Form1.Font.Style := Form1.Font.Style + [fsUnderline]
  else Form1.Font.Style := Form1.Font.Style - [fsUnderline];
  if I and 8 = 8 then Form1.Font.Style := Form1.Font.Style + [fsStrikeOut]
  else Form1.Font.Style := Form1.Font.Style - [fsStrikeOut];
end;
----------------------------------------------
Copyright 2008 ? NAILY Soft

Click here to redirect to my home
Click here to redirect to my blog
作者:
男 fdonne (fdonne) ★☆☆☆☆ -
盒子活跃会员
2004/4/27 13:43:19
2楼: 先谢了,试试看
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行70.3125毫秒 RSS