procedure TMainForm.PageControlWndProc(var Message: TMessage); begin
FOriginalPageControlWndProc(Message); with Message do if (Msg = TCM_ADJUSTRECT) and (Message.WParam = 0) then begin
InflateRect(PRect(LParam)^, 4, 4);
Dec(PRect(LParam)^.Top, 2) end; end;
procedure TMainForm.FormCreate(Sender: TObject); var
I: Integer; begin with PageControl1 do begin for I := 0 to PageCount - 1 do
Pages[I].TabVisible := False;
FOriginalPageControlWndProc := WindowProc;
WindowProc := PageControlWndProc;
ActivePage := TabSheet1;
Realign; end; end;