设置font size,遍历所有控件,有的控件没有font属性,所以要用GetPropInfo判断

if (GetPropInfo(cmp, "font"))

function GetObjectProperty(

const AObject   : TObject;

const APropName : string

):TObject;

var

PropInfo:PPropInfo;

begin

Result  :=  nil;

PropInfo:=GetPropInfo(AObject.ClassInfo,APropName);

if Assigned(PropInfo) and

(PropInfo^.PropType^.Kind = tkClass) then

Result  :=  GetObjectProp(AObject,PropInfo);

end;

function SetIntegerPropertyIfExists(

const AObject   : TObject;

const APropName : string;

const AValue    : integer

):Boolean;

var

PropInfo:PPropInfo;

begin

PropInfo:=GetPropInfo(AObject.ClassInfo,APropName);

if Assigned(PropInfo) and

(PropInfo^.PropType^.Kind = tkInteger) then

begin

SetOrdProp(AObject,PropInfo,AValue);

Result:=True;

end else

Result:=False;

end;

//调用

procedure TFrmTest.FormCreate(Sender: TObject);

var

objTemp : TObject;

begin

objTemp :=  GetObjectProperty(Self,'Font');

if Assigned(objTemp) then

SetIntegerPropertyIfExists(objTemp,'Size',9);

end;

GetPropInfo Font Size的更多相关文章

  1. XE6 c++builder 设置 font size GetPropInfo SetOrdProp

    PPropInfo ppi; PTypeInfo pti; TTypeKinds ttk; TRttiContext context; TRttiType *rttiType TObject* obj ...

  2. hiho #1288 微软2016.4校招笔试题 Font Size

    #1288 : Font Size 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Steven loves reading book on his phone. The ...

  3. LaTeX :font size 修改字体大小的几种方式

    调整字体大小的几种方式,大小依次增大,具体如下: \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \hu ...

  4. unity UGUI text font size对性能影响较大

    Font Size对ugui text的性能影响非常大. <Cube Duck Run>在itouch5上测试是很流畅的,但是在iphone5上测试,在game over后显示历史最高分时 ...

  5. UIAlertController custom font, size, color

    本文转载至 http://stackoverflow.com/questions/26460706/uialertcontroller-custom-font-size-color up vote2d ...

  6. Phone Font Size

    This table lists and describes the various font sizes that can be applied. Attribute = FontSize   Na ...

  7. PyCharm Change Font Size

    file->settings->colors&fonts-> save as (save the current scheme as your own)-> font- ...

  8. 【hihoCoder】1288 : Font Size

    题目:http://hihocoder.com/problemset/problem/1288 手机屏幕大小为 W(宽) * H(长),一篇文章有N段,每段有ai个字,要求使得该文章占用的页数不超过P ...

  9. LaTex Font Size 字体大小命令

    LaTex中字体大小有很多中等级,分别由下列命令控制: \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE ...

随机推荐

  1. HDU6387 AraBellaC

    题意 AraBellaC Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tota ...

  2. day30 python学习 struct模块和 subprocess 模块

    import subprocess import struct aa=input('>>') obj=subprocess.Popen(aa,shell=True,#aa代表的是读取字符串 ...

  3. sql server 创建内联表值函数

    表值函数就是返回table 的函数使用它可以方便的进行查询的处理 创建的代码如下: create FUNCTION returunclassfirstlist(  -- Add the paramet ...

  4. smarty学习——变量

    变量的处理对于模板来说是比较重要的. Smarty有几种不同类型的变量. 变量 的类型取决于它的前缀是什么符号(或者被什么符号包围) Smarty的变量可以直接被输出或者作为函数属性和修饰符(modi ...

  5. pow 的使用和常见问题

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/menxu_work/article/details/24540045 1.安装: $ curl ge ...

  6. 大快DKhadoop安装教程与常见问题汇总

    上周分别就DKHadoop的安装准备工作以及服务器操作系统配置写了两篇分享的文章,这是个人第一次尝试写一个系统性的分享文章,必然会有很多疏漏的地方,还望见谅吧.今天分享的是DKHadoop安装以及常见 ...

  7. MySQL 中间件 mycat 的使用

    什么是MYCAT 一个彻底开源的,面向企业应用开发的大数据库集群 支持事务.ACID.可以替代MySQL的加强版数据库 一个可以视为MySQL集群的企业级数据库,用来替代昂贵的Oracle集群 一个融 ...

  8. ML(3.1): NavieBayes R_e1071

    朴素贝叶斯方法是一种使用先验概率去计算后验概率的方法, 具体见ML(3): 贝叶斯方法 R包 ① e1071::e1071 ② klaR::klaR 参考资料:https://en.wikibooks ...

  9. Flask请求处理流程(request)[待续]

    WSGI简介 WSGI(全称Web Server Gateway Interface),是为 Python 语言定义的Web服务器和Web应用程序之间的一种简单而通用的接口,它封装了接受HTTP请求. ...

  10. redis和memcached选择,对比分析

    memcache和redis是互联网分层架构中,最常用的KV缓存.不少同学在选型的时候会纠结,到底是选择memcache还是redis? memcache提供的功能是redis提供的功能的子集,不用想 ...