Ver Mensaje Individual
  #1  
Antiguo 24-05-2015
Avatar de bulc
bulc bulc is offline
Miembro
 
Registrado: jun 2010
Posts: 415
Reputación: 14
bulc Va por buen camino
Intento dotar al TShape de Texto pero no consigo que funcione

He encontrado este código que me vendría muy bien pero no consigo hacerlo funcionar. ¿Seríais tan amables de decirme por qué no funciona?
Código Delphi [-]
type
  TShape = class(ExtCtrls.TShape); //interposer class

  TForm1 = class(TForm)
    Shape1: TShape;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
  public
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
    Shape1.Canvas.Font.Name :='Arial';// set the font 
    Shape1.Canvas.Font.Size  :=20;//set the size of the font
    Shape1.Canvas.Font.Color:=clBlue;//set the color of the text
    Shape1.Canvas.TextOut(10,10,'1999');
end;
Gracias
bulc
Responder Con Cita