这应该是 IW 中最重要的容器了, 和它同父的还有 TIWTabControl
TIWRegion 所在单元及继承链:
IWRegion.TIWRegion
主要成员:
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)
RenderInvisibleControls 属性测试:
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;
Splitter 属性测试:
{先放三个互不嵌套的 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;
效果图: