Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi. Remove a border of TabSheet of PageControl

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 will be straight.

like image 642
Michael Avatar asked Jun 08 '11 05:06

Michael


2 Answers

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.
like image 183
NGLN Avatar answered Nov 05 '22 21:11

NGLN


If you don't mind using third-party tools then the easiest solution would probably be to use TjvPageControl from JVCL. It has ClientBorderWidth property which you are looking for.

like image 29
Linas Avatar answered Nov 05 '22 22:11

Linas