使用 IntraWeb (14) - 基本控件之 TIWHRule、TIWRectangle

 
TIWHRule    //一條橫線, 對應 Html 中的 <hr/> TIWRectangle //矩形; 中間能夠有行文本, 文本可任意對齊


TIWHRule 所在單元及繼承鏈:
IWHTMLControls.TIWHRule < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject

它沒什麼特別的成員, 下面是經過樣式表把它改爲紅線:html


 
procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin   IWHRule1.Width := Width div 2;   IWHRule1.Height := 3;   IWHRule1.Left := (Width - IWHRule1.Width) div 2;   IWHRule1.Top := 60;   IWHRule1.Anchors := [akLeft, akTop, akRight]; end; procedure TIWForm1.IWHRule1HTMLTag(ASender: TObject; ATag: TIWHTMLTag); begin   ATag.Params.Values['style'] := ATag.Params.Values['style'] + 'background-color: red; border:0;'; end;



TIWRectangle 所在單元及繼承鏈:
IWCompRectangle.TIWRectangle < TIWCustomRectangle < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject

主要成員:spa


 
property BorderOptions: TIWBorderOptions //邊框選項; 主要是 Width 和 Color property Color: TIWColor                //矩形的顏色 property Alignment: TAlignment          //文本水平對齊方式 property VAlign: TIWVerticalAlignment    //文本垂直對齊方式 property Text: TCaption                  //文本


示例:code


 
procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin   IWRectangle1.BorderOptions.Width := 1;   IWRectangle1.BorderOptions.Color := $0000FF;   IWRectangle1.Color := $F0E0E0;   IWRectangle1.Text := '萬一的 Delphi 博客';   IWRectangle1.Font.Color := $0000FF;   IWRectangle1.Font.Size := 16;   IWRectangle1.Alignment := taCenter;   IWRectangle1.VAlign := vaMiddle; end;
相關文章
相關標籤/搜索