Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Kompo von TPanel ableiten und mit Canvas arbeiten (https://www.delphipraxis.net/45211-kompo-von-tpanel-ableiten-und-mit-canvas-arbeiten.html)

Alex_ITA01 2. Mai 2005 09:14


Kompo von TPanel ableiten und mit Canvas arbeiten
 
Hallo erstmal,
ich habe folgendes Problem. Ich habe mir eine Kompo erstellt, die vom Typ TPanel abgeleitet ist. Nun möchte ich innerhalb des Panels einfach nur ein Rechteck zeichnen...

Delphi-Quellcode:
procedure TMYPanel.Paint;
var
  R : TRect;
begin
  inherited;
  R.Left  := Self.Left + 1;
  R.Top   := Self.Top + 1;

  R.Right := Left + 10;
  R.Bottom := Self.Top + Self.Height;

  Canvas.Brush.Color := clBlue;
  Canvas.FillRect(R);
end;
Nur leider bekomme ich NIE dieses blaue Rechteck zu sehen... Wisst ihr was ich falsch mache?
Würde mich über jeden Tip freuen...
MFG Alex

Kroko1999 2. Mai 2005 09:17

Re: Kompo von TPanel ableiten und mit Canvas arbeiten
 
Delphi-Quellcode:
R.Left := 1;
R.top := 1;
es beginnt wieder bei 0,0

Alex_ITA01 2. Mai 2005 09:24

Re: Kompo von TPanel ableiten und mit Canvas arbeiten
 
jo, super...
Danke schön!!!


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:31 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz