TText 也是从 TShape(TControl -> TShape)继承;

而与之类似的 TLabel 的继承序列是 TControl -> TStyledControl -> TTextControl -> TLabel.

TText 的主要成员:
{ 属性 }
Text          : string;     //文本内容
Font          : TFont;      //字体
Fill          : TBrush;     //文本画刷
HorzTextAlign : TTextAlign; //横向对齐
VertTextAlign : TTextAlign; //纵向对齐
AutoSize      : Boolean;    //改变控件大小以适合文本
Stretch       : Boolean;    //拉伸文本以适合控件
WordWrap      : Boolean;    //是否换行

{ 方法 }
Realign; //重新对齐


TFont(来自 FMX.Types) 的主要成员:
{ 属性 }
Family : TFontName;   //名称
Size   : Single;      //大小
Style  : TFontStyles; //样式


procedure TForm1.FormCreate(Sender: TObject);
begin
  Text1.Align := TAlignLayout.alClient;

  Text1.Text := ' Delphi XE2 ';

  Text1.Font.Family := '微软雅黑';
  Text1.Font.Size := 32;
  Text1.Font.Style := [TFontStyle.fsBold, TFontStyle.fsUnderline];

  Text1.Fill.Color := claRed;
  Text1.Stretch := True;
end;

posted on 2011-09-22 17:54  万一  阅读(8674)  评论(1编辑  收藏  举报