Estimados Amigos gracias por sus Ayudas de antemano...
Como hago para crear un componente a partir de
TEdit, donde pueda ingresar solamente un signo POSITIVO o NEGATIVO o UN ESPACIO EN BLANCO... por cierto solo
un caracter;
EL PROBLEMA AQUI ES : QUE SE PUEDE INGRESAR CUALQUIER CANTIDAD DE SIGNOS... YO QUIERO SOLO
UNO... Aqui tengo un avance...:
Código Delphi
[-]
unit LeerSigno;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
Lsing = class(TEdit)
private
FConFocoColor: TColor;
FSinFocoColor: TColor;
procedure SetConFocoColor(Value: TColor);
procedure SetSinFocoColor(Value: TColor);
protected
procedure KeyPress(var Key: Char); override;
procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS;
procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property DelfinFocusColor: TColor read FConFocoColor write SetConFocoColor default clAqua;
property DelfinNoFocusColor: TColor read FSinFocoColor write SetSinFocoColor default clWhite;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('INTERESTED', [Lsing]);
end;
constructor Lsing.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FConFocoColor := clAqua;
FSinFocoColor := clWhite;
Font.Name := 'Tahoma';
Font.Size := 10;
Font.Style := [fsBold];
Height := 24;
Width := 20;
end;
destructor Lsing.Destroy;
begin
inherited Destroy;
end;
procedure Lsing.WMSetFocus(var Message: TWMSetFocus);
begin
inherited;
Color := FConFocoColor;
Invalidate;
end;
procedure Lsing.WMKillFocus(var Message: TWMKillFocus);
begin
inherited;
Color := FSinFocoColor;
SelStart := 0;
Invalidate;
end;
procedure Lsing.SetConFocoColor(Value: TColor);
begin
if FConFocoColor <> Value then
begin
FConFocoColor := Value;
Invalidate;
end;
end;
procedure Lsing.SetSinFocoColor(Value: TColor);
begin
if FSinFocoColor <> Value then
begin
FSinFocoColor := Value;
color := FSinFocoColor;
Invalidate;
end;
end;
procedure Lsing.KeyPress(var Key: Char);
begin
if (key <> #3) and (key <> #22) then
begin
if not (key in ['+', '-', ' ', #8]) then
key :=#0;
end
else
key := #0;
inherited KeyPress(Key);
end;
end.
AYUDA...

por favor lo necesito Urge...
