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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

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

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.

通過使用ActivePage或ActivePageIndex PageControl屬性來激活頁面不會引發OnChangeOnChanging事件。

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

要以編程方式設置活動頁面,請使用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.

使用此技術將使表單雜亂無章,從而使界面更加簡化,但要確保每個選項卡上控件的布置都不會迫使用戶在選項卡之間頻繁移動。

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

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。