Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 04-08-2006
interested interested is offline
Registrado
 
Registrado: ago 2006
Posts: 1
Poder: 0
interested Va por buen camino
Componente para signos ['+','-',' ']...

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);
    { Private declarations }
  protected
    procedure KeyPress(var Key: Char); override;
    procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS;
    procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS;
    { Protected declarations }
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    { Public declarations }
  published
    property DelfinFocusColor: TColor read FConFocoColor write SetConFocoColor default clAqua;
    property DelfinNoFocusColor: TColor read FSinFocoColor write SetSinFocoColor default clWhite;
    { Published declarations }
  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...
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Componente para Filtrar ADO, Para D5 olbeup OOP 5 14-09-2005 17:40:01
Componente para pasar de .Avi a .Jpg zugazua2001 Varios 1 10-07-2005 20:37:40
componente para norma19 para delphi7 raulmm26 Varios 3 07-02-2005 12:31:11
Signos inequívocos de que estás viviendo en el siglo XXI: tcp_ip_es Humor 0 31-05-2004 12:50:29
Signos Inequívocos De Que Estas Viviendo En El Siglo Xxi FRANKER Humor 0 27-06-2003 09:04:54


La franja horaria es GMT +2. Ahora son las 10:39:46.


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
Copyright 1996-2007 Club Delphi