Delphi. Remove a border of TabSheet of PageControl

前端 未结 4 1536

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 20:15

    unit Unit1;
    
    interface
    
    uses
      ...,
      CommCtrl;
    
    type
      TPageControl = class(ComCtrls.TPageControl)
      private
        procedure TCMAdjustRect(var Msg: TMessage); message TCM_ADJUSTRECT;
      end;
    
      TForm1 = class(TForm)
        ...
      end;
    
    ...
    
    procedure TPageControl.TCMAdjustRect(var Msg: TMessage);
    begin
      inherited;
      if Msg.WParam = 0 then
        InflateRect(PRect(Msg.LParam)^, 4, 4)
      else
        InflateRect(PRect(Msg.LParam)^, -4, -4);
    end;
    
    ...
    
    end.
    

提交回复
热议问题