Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   TDBEdit (https://www.clubdelphi.com/foros/showthread.php?t=571)

Un abrazo 19-05-2003 11:03:38

TDBEdit
 
Tengo un TDBEdit y quiero que cuando ponga sobre él un determinado texto se me activen otros edit que tengo con la propiedad enabled a false. Lo he hecho de la siguiente manera y no funciona

procedure TFEntradas.ERepresentanteExit(Sender: TObject);
begin
if ERepresentante.Text = 'S' then begin
ENifRepresentante.Enabled := true;
ENRepresentante.Enabled := true;
SBARepresentante.Enabled := true;
end else
Erepresentante.text := 'n';
ENifRepresentante.Enabled := false;
ENRepresentante.Enabled := false;
SBARepresentante.Enabled := false;

end;


Lo he probado con los eventos OnChange y OnExit y con ninguno funciona

Un Abraaaaaaaazo a Todos

Angel 19-05-2003 11:17:21

si como dices es un TDBEdit entonces escribe el código en el evento onValidate del campo en cuestión, es decir, todo este código

if ERepresentante.Text = 'S' then begin
ENifRepresentante.Enabled := true;
ENRepresentante.Enabled := true;
SBARepresentante.Enabled := true;
end else
Erepresentante.text := 'n';
ENifRepresentante.Enabled := false;
ENRepresentante.Enabled := false;
SBARepresentante.Enabled := false;

ponlo en el Onvalidades de la tabla (supongo que le tabla se llamará Representantes, el evento onValidate lo tienes que crear para el campo ERepresentante)

Lepe 19-05-2003 16:59:38

Una cochita tooonta.....
el else no tiene

begin

end


no será por esa tonteria no??? :D

[code]
if ERepresentante.Text = 'S' then begin
ENifRepresentante.Enabled := true;
ENRepresentante.Enabled := true;
SBARepresentante.Enabled := true;
end else begin
Erepresentante.text := 'n';
ENifRepresentante.Enabled := false;
ENRepresentante.Enabled := false;
SBARepresentante.Enabled := false;
end

Un abrazo 20-05-2003 09:23:13

Pues si era por el Begin - end. gracias tio.


Un Abraazo.

Lepe 20-05-2003 15:26:10

de nada hombre, es un placer, muchas veces pasa eso, estas tan obsecado con el programa que una cosa así te vuelve loco, y por más que lo miras lo ves bien :D, siempre es bueno que un tercer ojo eche una visual objetivamente.


Un saludo


La franja horaria es GMT +2. Ahora son las 18:40:06.

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