Active Control

Delphi

16/12/2004

ola,,

como faço para verificar se o componente clickado é um do tipo customCombobox e pegar a propriedade Text dele e jogar em uma StatusBar ??

Alguém pode me ajudar ?

Obrigado


By_gandalf

By_gandalf

Curtidas 0

Respostas

Dopi

Dopi

16/12/2004

Acho que dá pra usar o evento:

Screen.OnActiveControlChange

No exemplo abaixo ele pega o Hint do componente com o Foco atual e joga em um StatusBar...

procedure TfrPrincipal.MudouControle(Sender: TObject);
begin
Var AHint : String ;
begin
     AHint := ´´;
     if Screen.ActiveControl <> nil then
        if Screen.ActiveControl.ShowHint then
           AHint := GetLongHint(Screen.ActiveControl.Hint) ;

     StatusBar1.Panels[1].Text := AHint ;
end;

procedure TfrPrincipal.FormCreate(Sender: TObject);
begin
  Screen.OnActiveControlChange := MudouControle ;
.....
end;




GOSTEI 0
By_gandalf

By_gandalf

16/12/2004

Nao funcionou. Ele da o seguinte erro:

Incompatible types: Parameter lists differ

aqui a gente usa Frames.

Mesmo assim obrigado, vou tentar mais um pouco.


GOSTEI 0
POSTAR