Como saber se o Componente Ativo é descendente de BD?
04/11/2005
0
Desde já agradeço.
Fellipe H.
Titanius
Posts
05/11/2005
Firekiller
function IsDataset( Componente:TComponent ):Boolean; begin Result:=( Componente is TDataset ); end;
06/11/2005
Titanius
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;
07/11/2005
Titanius
[]s
07/11/2005
Bruno Belchior
Result := (Componente is TDateField) or (Component is TDateTimeField) or (Component is TTimeField);
07/11/2005
Titanius
IsField(Screen.ActiveControl, Now)
o Result, sempre retorna False
[]s
07/11/2005
Massuda
07/11/2005
Titanius
[]s
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].
Clique aqui para fazer login e interagir na Comunidade :)