The TPageControl Delphi control displays a set of pages used to make a multiple-page dialog box. Each page — a tab sheet — hosts its own controls. The user selects a page (makes it visible) by clicking the page’s tab that appears at the top of the control.

TPageControl Delphi控件显示一组用于创建多页对话框的页面。 每个页面(一个标签页)都拥有自己的控件。 用户通过单击显示在控件顶部的页面选项卡来选择页面(使其可见)。

隐藏PageControl选项卡 ( Hiding PageControl Tabs )

If you need to create a wizard-like user interface where you have Next and Previous buttons appearing to move a user forward and backward through a set of pages (dialogs), hide the tabs of the PageControl and thus disallow selecting a particular page by means of the user's mouse.

如果您需要创建一个类似向导的用户界面,其中出现“下一步”和“上一步”按钮以在一组页面(对话框)中前后移动用户,请隐藏PageControl的选项卡,从而禁止通过以下方式选择特定页面用户鼠标的位置。

The trick is in setting the TabVisible property to false for each of the sheets (TTabSheet object) of the page control.

技巧是将页面控件的每个工作表(TTabSheet对象)的TabVisible属性设置为false。

Activating the page by using either the ActivePage or the ActivePageIndex PageControl properties will not raise the OnChange and OnChanging events.

通过使用ActivePageActivePageIndex PageControl属性来激活页面不会引发OnChangeOnChanging事件。

To programmatically set the active page, use the SelectNextPage method:

要以编程方式设置活动页面,请使用SelectNextPage方法:

//Hide PageControl Tabsvarpage : integer;beginfor page := 0 to PageControl1.PageCount - 1 dobeginPageControl1.Pages[page].TabVisible := false;end;//select the first tabPageControl1.ActivePageIndex := 0;(*Or set Active Page directlyPageControl1.ActivePage := TabSheet1;Note: the above two do NOT raise theOnChanging and OnChange events*)end;procedure TForm1.PageControl1Changing(Sender: TObject;var AllowChange: Boolean) ;begin//no change if on the last pageAllowChange := PageControl1.ActivePageIndex < -1 + PageControl1.PageCount;end;//Select "Previous" Tabprocedure TForm1.PreviousPageButtonClick(Sender: TObject) ;beginPageControl1.SelectNextPage(false,false) ;end;//Select "Next" Tabprocedure TForm1.NextPageButtonClick(Sender: TObject) ;beginPageControl1.SelectNextPage(true,false) ;end;

Using this technique will de-clutter the form, leading to a more streamlined interface, but ensure that the arrangement of controls on each tab doesn't force the user to move frequently between tabs.

使用此技术将使表单杂乱无章,从而使界面更加简化,但要确保每个选项卡上控件的布置都不会迫使用户在选项卡之间频繁移动。

翻译自: https://www.thoughtco.com/hide-the-tabs-of-the-tpagecontrol-1057851

如何隐藏TPageControl Delphi控件的选项卡相关推荐

  1. element ui 图片控件 排序_Element-ui上传图片后隐藏上存控件

    在使用Element-ui el-upload组件的时候,发现我只想上存一张图片,比如头像的上存,然而上存一张后,控件还可以继续上存. 一下的方法是Element-ui上传图片后隐藏上存控件. 在el ...

  2. 使用IE WebControls中的TabStrip控件和MultiPage控件实现选项卡式风格页面(转载)

    第一步: 首先必须安装Internet Explorer WebControls.原始安装下载地址是:http://asp.net/IEWebControls/Download.aspx 下载后可以按 ...

  3. 计算机等级delphi取消,计算机二级DELPHI控件:DELPHI过滤记录的实现方法

    所谓过滤就是从表中选取满足特定条件的部分记录.过滤记录首先要通过Filter.属性设置过滤条件,然后将Filtered属性设置为True,即可从数据集组件连接的表中过滤出满足条件的记录. 1.Filt ...

  4. delphi 控件大全(确实很全)

    delphi 控件查询:Torry's Delphi Pages http://www.jrsoftware.org Tb97 最有名的工具条(ToolBar)控件库,仿Office97,如TDoCk ...

  5. Delphi控件-复合控件

    复合控件 复合控件是Delphi控件中非常重要的一种控件,复合控件就是将两个或两个以上的控件重新组合成一个新的控件.例如TspinEdit.TlabeledEdit.TDBNavigator等就是复合 ...

  6. delphi 控件大全

    delphi 控件查询:http://www.torry.net/ http://www.jrsoftware.org Tb97 最有名的工具条(ToolBar)控件库,仿Office97,如TDoC ...

  7. Delphi 控件开发步骤

    delphi 控件开发步骤 Delphi控件开发步骤 1.使用Delphi IDE的 Component -> New Component 菜单 2.按照向导逐步完成 3.控件工程文件 4.控件 ...

  8. Delphi控件开发浅入深出(一)

    有人说过"不会开发控件的Delphi程序员不是真正的程序员".Delphi正是由于高度的可扩展性和大量的第三方控件的支持才能吸引无数程序员挑剔的目光.即使是由于工作需要使用其他开发 ...

  9. MFC学习--下拉框、列表、树控件、选项卡

    下拉框.列表.树控件.选项卡 下拉框 属性 代码操作 列表控件 属性 代码操作 树控件 属性 代码操作 选项卡 属性 代码操作 文化建设 下拉框 属性 Data: 下拉可选项,用分号分隔( ; ) T ...

最新文章

  1. 使用VLC搭建RTSP服务器
  2. python文件分发_python 写一个文件分发小程序
  3. java怎么防止表单重复提交_如何防止表单重复提交
  4. 2022 年第一场云原生技术实践营开启报名
  5. 编译32位_玩转Android10源码开发定制(11)内核篇之安卓内核模块开发编译
  6. Connect 2016过后,你的信仰势必需要更大的容器
  7. solr elasticsearch比较
  8. 研华自动驾驶计算机,ADVANTECH研华TPC-1582H-433BE 工业平板电脑一体机计算机工控机...
  9. python创建对象_python对象
  10. zen3架构_曝Zen 3架构IPC性能将比Zen 2提升10~15%
  11. 自动化测试ROI计算器
  12. Python爬虫反爬方法
  13. VBA 字典使用小结:关键字循环
  14. 收到一个神盾局的offer,怎么样?
  15. 第六十一期:中国农民花3000块,发明史上最牛输入法!曾火遍中国20年
  16. STP生成树/BPDU保护小实验
  17. SIP穿越NAT SIP穿越防火墙
  18. Y件DOOK: VSC 安装 谷歌浏览器调试 固件插件 Debugger for Chorme
  19. 第16周项目3--用函数指针调用函数(吃饭,睡觉,打豆豆)
  20. Java.IO.InputStream-OutputStream

热门文章

  1. 用手动Ghost重装系统(gho镜像)
  2. linux中'.'的作用
  3. 国家自然科学基金计算机立项,2017年国家自然科学基金立项清单.PDF
  4. GNN:Weisfeiler-Lehman(WL)算法、WL-Test【GNN 的性能上界】
  5. Unity3d C#实现程序的加密狗验证功能(PC)
  6. R数据分析:潜增长模型LGM的做法和解释,及其与混合模型对比
  7. 百练4124:海贼王之伟大航路
  8. 便携式明渠流量计,您了解有多少?
  9. 小狗钱钱《读书笔记》系列(上)
  10. 痞子衡嵌入式:IAR内部C-SPY调试组件配套宏文件(.mac)用法介绍