Cannot focus a disabled or invisible window--Mas tá visível

Delphi

22/01/2004

[b:8ca363510d]Cannot focus a disabled or invisible window[/b:8ca363510d]

Aparece essa mensagem mas o componente está [b:8ca363510d]Com Certeza [/b:8ca363510d][u:8ca363510d]Visivel e Habilitado[/u:8ca363510d].....

Que coisa de loko.... :?

Alguém sabe o que mais pode ser??

Estou usando o código:

procedure TfrFornecedores.dbeCNPJChange(Sender: TObject);
begin
if (length(trim(dbeCNPJ.text)) = 14) and (dmDados.ibFornecedores.State in [dsEdit, dsInsert]) then
   dbeFantasia.SetFocus
end;


[b:8ca363510d][color=red:8ca363510d]Título editado pelo Moderador (AZ) - Removido: ´MAS TÁ VISIVEL!´[/color:8ca363510d][/b:8ca363510d]


Alex_

Alex_

Curtidas 0

Respostas

Nildo

Nildo

22/01/2004

Coloca mais uma condicao:
and dbeFantasia.Visible and dbeFantasia.Enabled and TWinControl(DbeFantasia.Parent).Visible and TWinControl(DbeFantasia.Parent).Enabled

Ou entao coloca um Try Except no SetFocus


GOSTEI 0
Beppe

Beppe

22/01/2004

Coloca mais uma condicao: and dbeFantasia.Visible and dbeFantasia.Enabled and TWinControl(DbeFantasia.Parent).Visible and TWinControl(DbeFantasia.Parent).Enabled Ou entao coloca um Try Except no SetFocus


Ou pede dbeFantasia.CanFocus. :!:


GOSTEI 0
Nildo

Nildo

22/01/2004

:oops:


GOSTEI 0
POSTAR