设置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. java调用.net的webservice

    目录(?)[-] 一参考文献 二概述 三实例 注意点   一.参考文献 1. http://www.cnblogs.com/xuqifa100/archive/2007/12/13/993926.ht ...

  2. java面试笔试题收集

    转载过来看看.... J2SE基础 1. 九种基本数据类型的大小,以及他们的封装类. 2. Switch能否用string做参数? 可以 3. equals与==的区别. 4. Object有哪些公用 ...

  3. 01.ubuntu14.04安装HI3518EV200 SDK的过程

    转载,侵删 1.海思SDK安装编译 Hi3518EV200_SDK是基于Hi3518EV200_DMEB的软件开发包,包含了在Linux相关应用开发时使用的各种工具及其源代码,是用户开发中最基本的软件 ...

  4. opencv mat flags含义

    f:\opencv\opencv\sources\modules\core\src\matrix.cpp:  flags = (_type & CV_MAT_TYPE_MASK) | MAGI ...

  5. oracle之 变更OS时间对数据库的影响

    本文:说明提供了操作系统日期变更对数据库.应用程序数据和作业的影响. 1.它将会影响插入的任何记录,如果涉及到sysdate,则更改日期.2.它还会影响在那个日期运行的任何调度器作业. 如果将系统时间 ...

  6. spring mvc 工作原理

    SpringMVC的工作原理图: SpringMVC流程 1.  用户发送请求至前端控制器DispatcherServlet. 2.  DispatcherServlet收到请求调用HandlerMa ...

  7. dede模块管理一片空白或没有列表内容的解决办法

    为什么dede后台模块管理,打开之后一片空白,又或者没有列表,插件与其他模块的使用也是正常的. 这主要是因为我们在安装模块,然后又卸载模块,卸载的时候选择了删除安装文件,就会出这个问题. 这里面分为两 ...

  8. BASIC-28_蓝桥杯_Huffuman树

    题目: 问题描述 Huffman树在编码中有着广泛的应用.在这里,我们只关心Huffman树的构造过程. 给出一列数{pi}={p0, p1, …, pn-1},用这列数构造Huffman树的过程如下 ...

  9. python2.7中出现TypeError: must be type, not classobj

    class Person: def __init__(self,name,age): self._name = name self._age = age class Student(Person): ...

  10. xml dom minidom

    一. xml相关术语: 1.Document(文档): 对应一个xml文件 2.Declaration(声明): <?xml version="1.0" encoding=& ...