Shapes at Runtime?
- From: cybatech@xxxxxxxxxxxxx
- Date: Fri, 29 Jul 2005 03:12:04 GMT
I create shapes at runtime and would like to have the user click a
label and change the shapes color to the same color as the shape.
The code below is what I am working with. Why does it not work?
procedure TForm1.Button1Click(Sender: TObject);
var
NewShape : TShape;
begin
NewShape := Tshape.Create(self);
NewShape.Left := 100;
NewShape.Top := 80;
NewShape.Parent := Self;
end;
procedure TForm1.Label1Click(Sender: TObject);
var
NewShape : TShape;
begin
if Sender is TShape then with Sender as TShape do
Begin
NewShape.Brush.Color:=label1.Color;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
end.
.
- Follow-Ups:
- Re: Shapes at Runtime?
- From: alanglloyd@xxxxxxx
- Re: Shapes at Runtime?
- Prev by Date: How Restore Docking on Undocked Window Close
- Next by Date: Re: Shapes at Runtime?
- Previous by thread: How Restore Docking on Undocked Window Close
- Next by thread: Re: Shapes at Runtime?
- Index(es):