hmm also mit diesem code will ich ein 20x20pixel großes shape links oben auf dem Panel haben welches ich erstelle nur wieso funzt das nicht:
Delphi-Quellcode:
unit MyPanel;
interface
uses
SysUtils, Classes, Controls, ExtCtrls,Graphics;
type
TMyPanel =
class(TPanel)
private
image1: TShape;
{ Private-Deklarationen }
protected
{ Protected-Deklarationen }
public
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
{ Public-Deklarationen }
published
{ Published-Deklarationen }
end;
procedure Register;
implementation
constructor TMyPanel.Create;
begin
inherited;
image1:= TShape.Create(self);
image1.Visible := true;
image1.Left := 0;
image1.Top := 0;
image1.Width:= 20;
image1.Height := 20;
end;
destructor TMyPanel.Destroy;
begin
image1.Free;
inherited;
end;
procedure Register;
begin
RegisterComponents('
Beispiele', [TMyPanel]);
end;
end.