Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Gráficos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-04-2005
David78 David78 is offline
Registrado
 
Registrado: abr 2005
Posts: 3
Poder: 0
David78 Va por buen camino
Crear un Shape en Runtime

Hola a todos,

Estoy intentando crear un Shape en tiempo de ejecución, pero no sé por qué no me lo hace. Con TButton sí que lo consigo fácilmente. El código que he hecho es el siguiente:
procedure TForm1.CreateShape;
var AShape: TShape;
begin
AShape:= TShape.Create(Panel1);
try
with AShape do
begin
Parent:= Self;
Left:= Random(Form1.ClientWidth-Width);
Top:= Random(Form1.ClientHeight-Height);
Brush.Color:= clWhite;
Brush.Style:= bsSolid;
Pen.Color:= clBlack;
Pen.Mode:= pmCopy;
Pen.Style:= psSolid;
Pen.Width:= 1;
end;
except
AShape.Free;
end;
end;

gracias por adelantado,
David
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 09:26:46.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi