Ver Mensaje Individual
  #4  
Antiguo 29-10-2010
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
Hice un ejemplo con los mismos datos que tu, solo que con edits en vez de dbgrids y quitando el self, no me da ningun error.
Da la impresion de que el problema podria estar en la carga de los dbgrids.
Código Delphi [-]
procedure TForm1.FormActivate(Sender: TObject);
begin
   if PageControl1.ActivePage = self.TabSheet1 then
 begin
   edit1.SetFocus;
 end;
 if PageControl1.ActivePage = self.TabSheet2 then
 begin
  edit2.SetFocus;
 end;
 if self.PageControl1.ActivePage = self.TabSheet3 then
 begin
  edit3.SetFocus;
 end;
end;

procedure TForm1.PageControl1Changing(Sender: TObject;
  var AllowChange: Boolean);
begin
  case TPageControl(Sender).TabIndex of
  0: edit1.SetFocus;
  1: edit2.SetFocus;
  2: edit3.SetFocus;
end;
end;
Saludos
__________________
Siempre Novato
Responder Con Cita