Sign in Join
Wiki copytemporary

TPageControl/zh CN: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11**TPageControl** ![](/wiki-images/4/44/Tpagecontrol.png) 是页面控件,可以容纳别的控件在自己的页面内。 TPageControl 继承于 [[TWinControl]] ,在 [[Common Controls tab]] 的 [[Component Palette]].
22
33不像 [[TTabControl]], 每个tab都连接到自己的页面. TPageControl的 ([[TTabSheet|TTabSheets]]) 都来自 *Pages* [[Property|property]]. 右键可以显示相关菜单, 使用“添加页”可以添加页面。
44
5-<figure>
6-<img src="component-TPageControl.png" title="component-TPageControl.png" />
7-<figcaption>component-TPageControl.png</figcaption>
8-</figure>
5+![](/wiki-images/c/c2/Component-TPageControl.png)
96
107当前Page可以通过 *ActivePage* 属性来进行访问操作。
118
129## 删除页面
1310
1411有多种方式可以删除Tab 下面所有方法都可以删除Tab,让Tab从控件中消失,已达到删除的目的。
1512
1613### 隐藏页面
1714
1815这个代码是隐藏该页,用户无法看到,但依旧存在,可以再次显示。
1916
2017``` pascal
2118Tabsheet2.TabVisible := false;
2219```
2320
2421### 改变父控件
2522
2623你可以将页面的父控件修改为任何控件,也可以设置为 **[[Nil|nil]]** 如果你想移动页面或者稍后再显示,此方法很好用。
2724
2825``` pascal
2926Tabsheet2.Parent := nil;
3027```
3128
3229### 释放控件
3330
3431如果完全不需要这个控件的时候可以Free掉。
3532
3633``` pascal
3734TabSheet2.Free;
3835TabSheet2:=nil; // this is optional
3936```
4037
4138## 其他资料
4239
4340- [[doc:lcl/comctrls/tpagecontrol.html|TPageControl doc]]
4441- [[doc:lcl/extctrls/multi-pagecontrols.html|Multi-page controls doc]]
4542- [[TNotebook]]
4643
4744---
4845*From the Free Pascal wiki, page "TPageControl/zh CN", as it stood on 2020-04-25 after a change by TyphonFinger, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history