FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
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 |
|
|
|