![]() |
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 |
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) |
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 |
Pues si era por el Begin - end. gracias tio.
Un Abraazo. |
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 09:19:01. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi