博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
类信息查看
阅读量:5265 次
发布时间:2019-06-14

本文共 2925 字,大约阅读时间需要 9 分钟。

unit Unit2;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls, ExtCtrls, Buttons;type  TinfoForm = class(TForm)    Label3: TLabel;    ListClasses: TListBox;    Panel1: TPanel;    Label1: TLabel;    Label2: TLabel;    ListParent: TListBox;    EditInfo: TEdit;    procedure FormCreate(Sender: TObject);    procedure ListClassesClick(Sender: TObject);  private    ClassArray: array of TClass;  public    { Public declarations }  end;var  infoForm: TinfoForm;implementation{$R *.dfm}procedure TinfoForm.FormCreate(Sender: TObject);var i: Integer;begin  SetLength(ClassArray,50);  ClassArray [0] := TButton;  ClassArray [1] := TBitBtn;  ClassArray [2] := TEdit;  ClassArray [3] := TSpeedbutton;  ClassArray [4] := TRadioButton;  ClassArray [5] := TRadioGroup;  ClassArray [6] := TPanel;  ClassArray [7] := TCheckBox;  ClassArray [8] := TForm;  ClassArray [9] := TComboBox;  ClassArray [10] := TGroupBox;  ClassArray [11] := TSpeedButton;  ClassArray [12] := TLabel;  ClassArray [13] := TListBox;  ClassArray [14] := TMemo;  for I := 0 to 15 do   ListClasses.Items.Add(ClassArray[i].ClassName);  ListClasses.ItemIndex := 0; ListClassesClick(nil);end;procedure TinfoForm.ListClassesClick(Sender: TObject);var MyClass: TClass;begin   MyClass := ClassArray[ListClasses.ItemIndex];   EditInfo.Text := Format('Name:%s - Size:%d',[MyClass.ClassName,MyClass.InstanceSize]);   ListParent.Clear;   with ListParent.Items do   begin      while MyClass.ClassParent <> nil do      begin         MyClass := MyClass.ClassParent;         Add(MyClass.ClassName);      end;   end;end;end.

  

object infoForm: TinfoForm  Left = 0  Top = 0  Caption = 'infoForm'  ClientHeight = 202  ClientWidth = 383  Color = clBtnFace  Font.Charset = DEFAULT_CHARSET  Font.Color = clWindowText  Font.Height = -11  Font.Name = 'Tahoma'  Font.Style = []  OldCreateOrder = False  OnCreate = FormCreate  PixelsPerInch = 96  TextHeight = 13  object Label3: TLabel    Left = 8    Top = 8    Width = 55    Height = 13    Caption = 'Class Name'  end  object ListClasses: TListBox    Left = 8    Top = 24    Width = 153    Height = 177    ItemHeight = 13    TabOrder = 0    OnClick = ListClassesClick  end  object Panel1: TPanel    Left = 168    Top = 8    Width = 209    Height = 193    Caption = 'Panel1'    TabOrder = 1    object Label1: TLabel      Left = 8      Top = 48      Width = 62      Height = 13      Caption = 'Base Classes'    end    object Label2: TLabel      Left = 8      Top = 8      Width = 25      Height = 13      Caption = 'Class'    end    object ListParent: TListBox      Left = 8      Top = 64      Width = 193      Height = 121      ItemHeight = 13      TabOrder = 0    end    object EditInfo: TEdit      Left = 8      Top = 24      Width = 193      Height = 21      ReadOnly = True      TabOrder = 1    end  endend

  

转载于:https://www.cnblogs.com/pengshaomin/archive/2012/02/15/2352415.html

你可能感兴趣的文章
[Java] 系统环境变量配置
查看>>
坏的事情不都会带来坏的结果
查看>>
设置placeholder的样式
查看>>
RPC的基础:调研EOS插件http_plugin
查看>>
HIT1946 希尔伯特分形曲线(dfs)
查看>>
第二次团队冲刺第二天
查看>>
青瓷引擎之纯JavaScript打造HTML5游戏第二弹——《跳跃的方块》Part 2
查看>>
bzoj 2257 (JSOI 2009) 瓶子与燃料
查看>>
11)Java abstract class 和 interface
查看>>
使用xrdp或Xmanager 远程连接 CentOS6
查看>>
CDC类介绍
查看>>
SEH简单研究
查看>>
Dubbo -- 系统学习 笔记 -- 配置参考手册
查看>>
LeetCode Problem 3.Longest Substring Without Repeating Characters
查看>>
Linux误删恢复
查看>>
eclipse中的.project 和 .classpath文件的具体作用是什么?
查看>>
Unity调用Windows窗口句柄,选择文件和目录
查看>>
字节流缓存
查看>>
HashMap循环遍历方式
查看>>
python面试题(二)顺时针打印二维数组,快速排序
查看>>