Fórum Como saber se o Componente Ativo é descendente de BD? #301831
04/11/2005
0
Desde já agradeço.
Fellipe H.
Titanius
Curtir tópico
+ 0Posts
05/11/2005
Firekiller
function IsDataset( Componente:TComponent ):Boolean; begin Result:=( Componente is TDataset ); end;
Gostei + 0
06/11/2005
Titanius
Gostei + 0
06/11/2005
Bruno Belchior
function IsField(Componente: TComponent; Valor: Variant): Boolean; begin Result := (Componente is TField); if Result then begin (Componente as TField).AsVariant := Valor; end; end;
Gostei + 0
07/11/2005
Titanius
Gostei + 0
07/11/2005
Titanius
[]s
Gostei + 0
07/11/2005
Bruno Belchior
Result := (Componente is TDateField) or (Component is TDateTimeField) or (Component is TTimeField);
Gostei + 0
07/11/2005
Titanius
IsField(Screen.ActiveControl, Now)
o Result, sempre retorna False
[]s
Gostei + 0
07/11/2005
Massuda
Gostei + 0
07/11/2005
Titanius
[]s
Gostei + 0
07/11/2005
Massuda
Todo controle data aware é construído agregando a ele um objeto interno derivado da classe TDataLink e/ou TFieldDataLink.
O modo mais fácil de testar se um controle é data aware parece ser testar se o controle possui a propriedade DataSource do tipo TDataSource... tem alguns exemplos aqui no fórum de como fazer isso, por exemplo, [url=http://forum.clubedelphi.net/viewtopic.php?t=56637]este tópico[/url].
Gostei + 0
07/11/2005
Titanius
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)