日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

如何隐藏TPageControl Delphi控件的选项卡

發(fā)布時(shí)間:2023/12/15 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何隐藏TPageControl Delphi控件的选项卡 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

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控件顯示一組用于創(chuàng)建多頁對話框的頁面。 每個(gè)頁面(一個(gè)標(biāo)簽頁)都擁有自己的控件。 用戶通過單擊顯示在控件頂部的頁面選項(xiàng)卡來選擇頁面(使其可見)。

隱藏PageControl選項(xiàng)卡 ( 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.

如果您需要?jiǎng)?chuàng)建一個(gè)類似向?qū)У挠脩艚缑?#xff0c;其中出現(xiàn)“下一步”和“上一步”按鈕以在一組頁面(對話框)中前后移動(dòng)用戶,請隱藏PageControl的選項(xiàng)卡,從而禁止通過以下方式選擇特定頁面用戶鼠標(biāo)的位置。

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

技巧是將頁面控件的每個(gè)工作表(TTabSheet對象)的TabVisible屬性設(shè)置為false。

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

通過使用ActivePage或ActivePageIndex PageControl屬性來激活頁面不會(huì)引發(fā)OnChangeOnChanging事件。

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

要以編程方式設(shè)置活動(dòng)頁面,請使用SelectNextPage方法:

//Hide PageControl Tabs
var
page : integer;
begin
for page := 0 to PageControl1.PageCount - 1 do
begin
PageControl1.Pages[page].TabVisible := false;
end;
//select the first tab
PageControl1.ActivePageIndex := 0;
(*
Or set Active Page directly
PageControl1.ActivePage := TabSheet1;
Note: the above two do NOT raise the
OnChanging and OnChange events
*)
end;
procedure TForm1.PageControl1Changing(
Sender: TObject;
var AllowChange: Boolean) ;
begin
//no change if on the last page
AllowChange := PageControl1.ActivePageIndex < -1 + PageControl1.PageCount;
end;
//Select "Previous" Tabprocedure TForm1.PreviousPageButtonClick(Sender: TObject) ;
begin
PageControl1.SelectNextPage(false,false) ;
end;
//Select "Next" Tabprocedure TForm1.NextPageButtonClick(Sender: TObject) ;
begin
PageControl1.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.

使用此技術(shù)將使表單雜亂無章,從而使界面更加簡化,但要確保每個(gè)選項(xiàng)卡上控件的布置都不會(huì)迫使用戶在選項(xiàng)卡之間頻繁移動(dòng)。

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

總結(jié)

以上是生活随笔為你收集整理的如何隐藏TPageControl Delphi控件的选项卡的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。