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 |
A mi me ha funcionado tu código así que supongo que lo que sucede es que el objeto que creas no lo ves porque queda oculto por el panel. Donde dice
Parent := Self; creo que querías decir Parent := Panel1; // Saludos |
Cita:
circulos.OnMouseDown:= circulosMouseDown('no se q parametros van a qui') espero me puedan orientar, gracias |
Cita:
Saludos. |
gracias, si me funciono, muchas gracias
|
La franja horaria es GMT +2. Ahora son las 16:23:02. |
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