Ver Mensaje Individual
  #3  
Antiguo 24-05-2015
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
bulc,

Cita:
Empezado por bulc
...este código que me vendría muy bien pero no consigo hacerlo funcionar...


Pregunto:

1- ¿Que versión de Windows y de cuantos bits (32/64) utiliza tu aplicación?.

2- ¿Que versión de Delphi utiliza tu aplicación?.

3- ¿Puedes detallar o mostrar el problema señalado?.

Revisa este código:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, Math;

type

  TShape = class(ExtCtrls.TShape);

  TForm1 = class(TForm)
    Shape1: TShape;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
   Number : Integer;

begin

    Randomize;
    Number := RandomRange(1999,2016);

    Shape1.Canvas.Brush.Color := clSkyBlue;
    Shape1.Canvas.Font.Name :='Arial';
    Shape1.Canvas.Font.Size := 30;
    Shape1.Canvas.Font.Color := clBlue;
    Shape1.Canvas.TextOut(10,10,IntToStr(Number));

end;

end.
El código anterior en Delphi 7 sobre Windows 7 Professional x32, Implementa un TShape e imprime texto sobre el mismo de forma dinámica, como se muestra en la siguiente imagen:



Espero sea útil

Nelson.
Responder Con Cita