這應該是 IW 中最重要的容器了, 和它同父的還有 TIWTabControl
property Align: TAlign property Anchors: TAnchors property BorderOptions: TIWContainerBorderOptions //設置邊框的寬度、顏色、樣式 property Color: TIWColor property ClipRegion: Boolean //對應 CSS clip, 如果控件大於區域, 是否剪切; 默認 True property LayoutMgr: TIWContainerLayout //要套用的布局管理器 property Splitter: Boolean //是否提供分割線; 它出現的位置與 Align 屬性有關系 property StyleRenderOptions: TIWStyleRenderOptions property Visible: Boolean property DoRefreshControl: Boolean property InternalTabOrder: TTabOrder property ContainerContext: TIWContainerContext property IWComponentsCount: Integer property RenderInvisibleControls: Boolean //是否呈現隱藏的控件; 默認 False property HorzScrollBar: TControlScrollBar property VertScrollBar: TControlScrollBar property OnCreate: TNotifyEvent property OnRender: TNotifyEvent procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer) procedure Invalidate function OwnerForm: TIWBaseForm function OwnerFrame: TIWHTMLContainer procedure Freeing(AObject: TObject) procedure ForceAlign procedure DisableAutoRange procedure EnableAutoRange procedure ScrollInView(AControl: TControl)
procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin IWRectangle1.Visible := False; //假如 IWRectangle1 在 IWRegion1 內, 並且已經隱藏了 IWRegion1.RenderInvisibleControls := True; //如果不指定 RenderInvisibleControls := True 那麼再從異步事件中設置 IWRectangle1.Visible := True 將無效 end; {OnAsyncClick} procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList); begin IWRectangle1.Visible := not IWRectangle1.Visible; end;
{先放三個互不嵌套的 TIWRegion} procedure TIWForm1.IWAppFormCreate(Sender: TObject); begin IWRegion1.Color := $ff0000; IWRegion2.Color := $0000ff; IWRegion3.Color := $00ff00; IWRegion1.Align := alTop; IWRegion2.Align := alLeft; IWRegion3.Align := alClient; IWRegion1.Splitter := True; IWRegion2.Splitter := True; end;