如何得到一个属性的为 tkSET (如 ANCHORS,FONT.STYLE等)的  所有可能的组成项目?谢谢

解决方案 »

  1.   

    告诉你,我找到答案了!!!
    用DELPHI的帮助可以解决:
    比如你想知道与tkSET一道的还有些什么项目,你可以在“帮助主题”的索引里输入关键字“tkSET”,然后在弹出的提示框中选“TTypeKind...”然后点“显示”,OK!!!出来了:
    TTypeKind = (tkUnknown, tkInteger, tkChar, tkEnumeration, tkFloat, tkString, tkSet, tkClass, tkMethod, tkWChar, tkLString, tkWString, tkVariant, tkArray, tkRecord, tkInterface, tkDynArray);你想知道ANchors的项目,可在索引中输入“TANCHORS”,会自动找到“TANCHORS TYPE”然后显示,OK!!!又出来了:
    type TAnchorKind = (akTop, akLeft, akRight, akBottom);DescriptionTAnchors is a set of TAnchorKind values. TAnchorKind can have one or more of the following values:Value MeaningakTop The control抯 position is fixed with respect to the top edge of its parent.
    akLeft The control抯 position is fixed with respect to the left edge of its parent.
    akRight The control抯 position is fixed with respect to the right edge of its parent.
    akBottom The control抯 position is fixed with respect to the bottom edge of its parent.你想知道FONT.STYLE,也一样,你输入"TFontStyle type"然后显示,OK:
    TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut);  TFontStyles = set of TFontStyle;property Style: TFontStyles;DescriptionUse Style to add special characteristics to characters that use the font. Style is a set containing zero or more values from the following:Value MeaningfsBold The font is boldfaced.
    fsItalic The font is italicized.
    fsUnderline The font is underlined.
    fsStrikeOut The font is displayed with a horizontal line through it.
      

  2.   

    to  mrtxc(阿春) 
    谢谢
    不过,我希望的是如何用程序读出来,写到一个文件中
      

  3.   

    to  mrtxc(阿春) 
    多谢!!!
      

  4.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls,TypInfo;type
      TForm1 = class(TForm)
        Memo1: TMemo;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
    implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);varMyTypeInfo: PTypeInfo;
    MyTypeData: PTypeData;
    i,a,b: Integer;
    begin
      MyTypeInfo := TypeInfo(TFontStyle);  // 把这里换成TANChorKind,ttypekind就
                                           //就可得到TANChorKind,TTypeKind的值  MyTypeData := GetTypeData(MyTypeInfo);
      a:=MyTypeData^.MinValue;
      b:=MyTypeData^.MaxValue;
      for i := MyTypeData^.MinValue to MyTypeData^.MaxValue do
        memo1.Lines .Add(GetEnumName(MyTypeInfo, i)); //将得到的值添加到Memo1中
    end;end.
    *****一定记住在uses中加入TypInfo
    以上程序在Delphi6,Win2k中通过!!!我爱Delphi,更爱热爱Delphi的人。
    但愿成为朋友!!!