Ver Mensaje Individual
  #1  
Antiguo 26-11-2009
Avatar de GerTorresM
GerTorresM GerTorresM is offline
Miembro
 
Registrado: nov 2005
Ubicación: Tunja - Boyacá
Posts: 210
Reputación: 19
GerTorresM Va por buen camino
Question Localizar un componente y darle el foco

Hola a Todos:

Me encuentro escibiendo un procedimiento mediante el cual pueda darle el foco a un control ej boton, edit; el código que utilizo es el siguiente

Código Delphi [-]
procedure EstablecerFoco(Formulario : TForm; Control : TWinControl);
begin
   Try
     Formulario.FindComponent('Control') as TWinControl;
     Formulario.Control.SetFocus;
   Except
     MessageDlg('No se lozalizo el control ' + Control.Name, mtInformation,[mbOk], 0);
   End;
end;

al intentar correr queda en la cuarta linea y me envia los siguientes mensajes

[Error] UProcedimientos.pas(425): Statement expected, but expression of type 'TWinControl' found
[Error] UProcedimientos.pas(426): Undeclared identifier: 'Control'
[Error] UProcedimientos.pas(426): Not enough actual parameters

Y la verdad no tengo ni idea que debio hacer, agradezco su colaboración


gertorresm
Responder Con Cita