TIWTabControl 包含的是 TIWTabPage; 设计时通过右键菜单 Add Page 添加(再给页面添加东西时一定要先选定页面); 下面例子是动态添加的.


TIWTabControl 所在单元及继承链:
IWCompTabControl.TIWTabControl

主要成员:


property Pages: TList //TIWTabPage 对象的集合; 但它是 TList 类型, 使用前需转换下
property ActiveTabFont: TIWFont //当前 Tab 标签的字体
property ActiveTabColor: TIWColor //当前 Tab 标签的背景色
property InactiveTabFont: TIWFont //其他 Tab 标签的字体
property InactiveTabColor: TIWColor //其他 Tab 标签的背景色
property ActivePage: Integer //当前页号; 如果需要设置它将导致提交, 官方给出了通过 js 进行本地设置的方法: IWTABCONTROL1.tabPane.setSelectedIndex(i);
property BorderOptions: TIWContainerBorderOptions //它的边框选项还是比较复杂的, 个人觉得: 如果需要边框还不如套个 TIWRegion
property LayoutMgr: TIWContainerLayout //布局管理器, 它也可以用模板(它是从 TIWCustomRegion 继承的)
property Color: TIWColor // property OnChange: TNotifyEvent //
property OnAsyncChange: TIWAsyncEvent // procedure Submit(const AValue: string) //
procedure pageAdded(APage: TIWTabPage) //
procedure pageRemoved(APage: TIWTabPage) //
function CreateNewPage(const APageTitle: string; const APageName: string): TIWTabPage //

TIWTabPage:


{IWCompTabControl.TIWTabPage

测试:

{先在空白窗体上放 1 个 TIWTabControl, 3 个 TIWTabPage, 2 个 TIWButton}
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
var
fPage1, fPage2, fPage3: TIWTabPage;
begin
//动态建立 3 个 TIWTabPage
fPage1 := IWTabControl1.CreateNewPage(' Page1 ');
fPage2 := IWTabControl1.CreateNewPage(' Page2 ');
fPage3 := IWTabControl1.CreateNewPage(' Page3 '); //让 IWButton1 具备切换标签的功能
JavaScript.Add('var i = 0;'); //js 全局变量
IWButton1.ScriptEvents.HookEvent('onclick', 'i++; i%=3; IWTABCONTROL1.tabPane.setSelectedIndex(i);'); //IWTABCONTROL1 或换成 IWTABCONTROL1IWCL IWTabControl1.Color := $efefef;
IWTabControl1.InactiveTabColor := $efefef;
IWTabControl1.ActiveTabColor := $0000ff; IWGrid1.Parent := fPage1;
IWGrid2.Parent := fPage2;
IWGrid3.Parent := fPage3; IWGrid1.RowCount := 3;
IWGrid1.ColumnCount := 4;
IWGrid1.BGColor := $ffeeee;
IWGrid1.CellPadding :=4;
IWGrid1.Align := alTop; IWGrid2.RowCount := 4;
IWGrid2.ColumnCount := 5;
IWGrid2.BGColor := $eeeeff;
IWGrid2.CellPadding := 4;
IWGrid2.Align := alTop; IWGrid3.RowCount := 5;
IWGrid3.ColumnCount := 6;
IWGrid3.BGColor := $eeffee;
IWGrid3.CellPadding := 4;
IWGrid3.Align := alTop;
end; {测试 Pages 属性}
procedure TIWForm1.IWButton2Click(Sender: TObject);
begin
WebApplication.ShowMessage(TIWTabPage(IWTabControl1.Pages[0]).Title); // Page1
end;

效果图:


使用 IntraWeb (21) - 基本控件之 TIWTabControl的更多相关文章

  1. 使用 IntraWeb (25) - 基本控件之 TIWRegion

    这应该是 IW 中最重要的容器了, 和它同父的还有 TIWTabControl TIWRegion 所在单元及继承链: IWRegion.TIWRegion 主要成员: property Align: ...

  2. 使用 IntraWeb (24) - 基本控件之 TIWFileUploader、TIWFile

    TIWFileUploader 是基于 Ajax 的上传控件, 最初是 Andrew Valums 开发, 从 IntraWeb XIV 纳入并替换 TIWFile. 虽然从组件面板上还能看到 TIW ...

  3. 使用 IntraWeb (29) - 基本控件之 TIWAutherList、TIWAutherINI、TIWAutherEvent

    TIWAutherList //通过一组户名与密码验证登陆 TIWAutherINI //通过记录户名与密码信息的 #Auth.ini 文件验证登陆 TIWAutherEvent //通过其 OnCh ...

  4. 使用 IntraWeb (28) - 基本控件之 TIWTemplateProcessorHTML、TIWLayoutMgrHTML、TIWLayoutMgrForm

    TIWTemplateProcessorHTML //使用外部的 html 文件做模板 TIWLayoutMgrHTML //直接输入 Html 文本做模板 TIWLayoutMgrForm //这应 ...

  5. 使用 IntraWeb (26) - 基本控件之 TIWMenu

    TIWMenu 的任务是让原来的 TMainMenu 呈现在网页上, 通过其 AttachedMenu 属性关联一个 TMainMenu 是必需的. TIWMenu 所在单元及继承链: IWCompM ...

  6. 使用 IntraWeb (23) - 基本控件之 TIWTimer、TIWProgressBar、TIWProgressIndicator、TIWTimeEdit

    TIWTimer //和 TTimer 没多大区别, 它的默认事件现在是异步的(OnAsyncTimer), 在网络上使用 OnTimer 肯定是非常糟糕的 TIWProgressBar //进度条 ...

  7. 使用 IntraWeb (22) - 基本控件之 TIWCalendar

    TIWCalendar: 日历控件, 继承于 TIWCustomGrid, 所以它和 TIWGrid 共同属性特多. 它的 Cell 是 TIWCalendarCell 对象, 直接从 TIWGrid ...

  8. 使用 IntraWeb (20) - 基本控件之 TIWGrid

    TIWGrid 最终通过 Html Table 呈现; 其每个 Cell 都是一个 TIWGridCell 对象, Cell 对象的 Control 属性非常好, 可以非常方便地嵌入其他控件. TIW ...

  9. 使用 IntraWeb (19) - 基本控件之 TIWTreeView

    这是个饱受非议的控件; 我通过尝试, 理解了非议, 也能理解作者. 总之向作者的思路靠拢吧, 还是不错的. TIWTreeView 所在单元及继承链: IWCompTreeview.TIWTreeVi ...

随机推荐

  1. [整理]ASP.NET 中异常处理

    [整理]ASP.NET 中异常处理 1.直接通过重写Controller的OnException来处理异常 public class HomeController : Controller { pub ...

  2. 第12月第30天 love2d

    1. Linux On Linux, you can use one of these command lines: love /home/path/to/gamedir/ love /home/pa ...

  3. JAVA不可变类与可变类、值传递与引用传递深入理解

    一个由try...catch...finally引出的思考,在前面已经初步了解过不可变与可变.值传递与引用传递,在这里再次深入理解. 1.先看下面一个try..catch..finally的例子: P ...

  4. RPM Database

    RPM Database RPM 不仅在安装.升级.卸载方面工作出色,而且在查询和验证方面也表现非凡.你很久前安装了一个数据库软件,但现在忘记了它的版本号,也不知道它的说明文档的位置,可以通过 RPM ...

  5. MySQL的Auto-Failover功能

    今天来体验一下MySQL的Auto-Failover功能,这里用到一个工具MySQL Utilities,它的功能很强大.此工具提供如下功能:(1)管理工具 (克隆.复制.比较.差异.导出.导入)(2 ...

  6. USB-HID鼠标、键盘通讯格式【转】

    转自:https://blog.csdn.net/techhome803/article/details/9928873 转自:http://www.amobbs.com/forum.php?mod= ...

  7. lvs+keepalived+nginx实现高性能负载均衡集群【转】

    转自 lvs+keepalived+nginx实现高性能负载均衡集群 - 青衫lys - 博客园http://www.cnblogs.com/liuyisai/p/5990645.html 一.为什么 ...

  8. Zookeeper的java客户端API使用方法(五)

    前面几篇博文,我们简单的介绍了一下zookeeper,如何安装zookeeper集群,以及如何使用命令行等.这篇博文我们重点来看下Zookeeper的java客户端API使用方式. 创建会话 客户端可 ...

  9. 【论文阅读】HydraPlus-Net: Attentive Deep Features for Pedestrian Analysis

    转载请注明出处:https://www.cnblogs.com/White-xzx/ 原文地址:https://arxiv.org/abs/1709.09930 Github: https://git ...

  10. SendMessage原理初探

    今天跟踪一下SendMessage的实现. 用向导先创建一个Windows application. 向导生成了一个简单的窗口,如下. 在File菜单添加SendMessage,顺便添加一个PostM ...