Recent

Author Topic: Certain controls don't draw correctly  (Read 2075 times)

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: Certain controls don't draw correctly
« Reply #15 on: May 01, 2021, 07:00:05 pm »
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. Var
  3.   R:TRect;
  4.   C:TCanvas;
  5.   P:TTabSheet;
  6. begin
  7.   C:= TCanvas.Create;
  8.   P := PageControl1.ActivePage;
  9.   C.Handle := GetDC(P.Handle);
  10.   R := R.Create(0,0,P.Width-1, P.Height-1);
  11.   With C do
  12.    Begin
  13.     Pen.Color := clRed;
  14.     Pen.Style := psSolid;
  15.     Pen.Width := 1;
  16.     Frame(R);
  17.    end;
  18.    ReleaseDC(P.Handle,C.handle);
  19.  C.Free;
  20. end;                          
  21.  
  22.  
That is drawing on the sheet itself ..
The only true wisdom is knowing you know nothing

pcurtis

  • Hero Member
  • *****
  • Posts: 951
Re: Certain controls don't draw correctly
« Reply #16 on: May 02, 2021, 02:41:51 am »
@jamie - thanks
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

pcurtis

  • Hero Member
  • *****
  • Posts: 951
Re: Certain controls don't draw correctly
« Reply #17 on: May 02, 2021, 03:45:29 am »
That said, it opens another can of worms.

The tabsheet doesn't fill the pagecontrol completely. There is an uneven border around the tabsheet  :(
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

 

TinyPortal © 2005-2018