zoukankan      html  css  js  c++  java
  • RTTI(一) 枚举

    SetEnumProp
    void __fastcall TForm2::Button1Click(TObject *Sender)
    {
        //Getting the current color of the workspace
        String currentPropColor = GetEnumProp(this,"Color");
        int currentColorInt = StrToInt(currentPropColor);
     
        //Getting the first button align enum and, if different,
        //setting it to alLeft
        String currentAlignProp = GetEnumProp(Button1, "Align");
        if (currentAlignProp != "alLeft")
        {
             SetEnumProp(Button1, "Align", "alLeft");
         }
     
        //Checking if the form background color was set.
        if(currentColorInt < 0)
        {
            currentColorInt = GetSysColor(COLOR_APPWORKSPACE);
        }
     
        //Setting the form background color as the negative value
        //of the current background color
        SetEnumProp(this, "Color",
                    IntToStr((int)(clWhite - currentColorInt)));
    }
     
    void __fastcall TForm2::Button2Click(TObject *Sender)
    {
        int p[5] = {clYellow, clGreen, clRed, clBlue, clBlack};
        SetEnumProp(this, "Color", IntToStr(p[random(5)]));
     
        //Getting the second button align enum and, if different,
        //setting it to alRight
        String currentAlignProp = GetEnumProp(Button2, "Align");
        if (currentAlignProp != "alRight")
        {
             SetEnumProp(Button2, "Align", "alRight");
         }
    }
  • 相关阅读:
    机器人搬重物(BFS)
    POJ1386Play on Words(欧拉回路)
    轰炸
    杂务(动态规划)
    Prism框架的Regions使用
    MVVM(使用Prism框架)开发WPF
    WPF显示数据库内容
    UI案例
    VS的快捷操作
    谷歌浏览器插件安装、VIP看视频、解除百度网盘限速
  • 原文地址:https://www.cnblogs.com/cb168/p/4643967.html
Copyright © 2011-2022 走看看