Delphi. Remove a border of TabSheet of PageControl

前端 未结 4 1521

Your help is needed.

Is it possible to remove a border of TabSheet (~4px)? I am using PageControl as a switch-panel instead of frames, windows etc. I want everything wil

4条回答
  •  一向
    一向 (楼主)
    2021-02-05 19:56

    An alternative is to use a TTabSet with a TPageControl: In the onCreate event of the form, place this code to hide the tab.

    procedure TMainForm.FormCreate(Sender: TObject);
    var
        I : Integer;
    begin
       for I := 0 to Pred(PageControl1.PageCount) do
           PageControl1.Pages[I].TabVisible := False;
       PageControl1.Style := tsFlatButtons;
       PageControl1.ActivePageIndex := 0;
    
       TabSet1.Style := tsModernPopout;
       TabSet1.SelectedColor := clMoneyGreen;
       TabSet1.UnselectedColor := clGradientActiveCaption;
       TabSet1.SelectedColor := clGradientActiveCaption;
    end;
    
    
    procedure TMainForm.TabSet1Change(Sender: TObject; NewTab: Integer;
      var AllowChange: Boolean);
    begin
       PageControl1.ActivePageIndex := NewTab;
    end;
    

提交回复
热议问题