Ver Mensaje Individual
  #3  
Antiguo 10-09-2011
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Reputación: 10
marcoszorrilla Va por buen camino
Pues lo acabo de probar y solamente me funciona OnlyNumber.
Código Delphi [-]
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure OnlyNumber(Sender: TWinControl);
begin
  SetWindowLong(Sender.Handle, GWL_STYLE,
    GetWindowLong(Sender.Handle, GWL_STYLE) + ES_NUMBER);
end;

(* Centrar texto *)
procedure CenterJustifyText(Sender: TWinControl);
begin
  SetWindowlong(Sender.Handle, GWL_STYLE,
    GetWindowlong(Sender.Handle, GWL_STYLE) + ES_CENTER);
end;

(* Alinear a la derecha *)
procedure RightJustifyText(Sender: TWinControl);
begin
  SetWindowLong(Sender.Handle, GWL_STYLE,
    GetWindowLong(Sender.Handle, GWL_STYLE) + ES_RIGHT);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
  OnlyNumber(Edit1);
  CenterJustifyText(Edit2);
  RightJustifyText(Edit3);
end;

end.
Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita