[Resolvido] Chamar uma Procedure do proprio Delphi.
Eu to precisando executar uma procedure em outro evento que não seja o dele mesmo.
No caso essa:
>
procedure TfPesquisar.btOkClick(Sender: TObject);
begin
If rgPesquisar.ItemIndex = 0 Then Begin
//lbPesquisar.Caption := 'Codigo';
ibqSelect.Close;
ibqSelect.SQL.Clear;
ibqSelect.SQL.Text := ' Select * From ENTIDADES Where ENTIDADEID Like ' + QuotedStr('%' +edPesquisar.Text+ '%');
ibqSelect.Open;
End;
If rgPesquisar.ItemIndex = 1 Then Begin
//lbPesquisar.Caption := 'Nome';
ibqSelect.Close;
ibqSelect.SQL.Clear;
ibqSelect.SQL.Text := 'Select * From ENTIDADES Where Upper(ENTIDADE) Like Upper(' + QuotedStr('%'+edPesquisar.Text+ '%')+ ')';
ibqSelect.Open;
End;
If rgPesquisar.ItemIndex = 2 Then Begin
//lbPesquisar.Caption := 'Contato';
ibqSelect.Close;
ibqSelect.SQL.Clear;
ibqSelect.SQL.Text := 'Select * From ENTIDADES Where Upper(CONTATO) Like Upper(' + QuotedStr('%' + edPesquisar.Text+ '%')+ ')';
ibqSelect.Open;
End;
end;
Só que quero que ela seja executada no Evento OnChane do Edit (edPesquisar).
Tentei colocar como se fosse um procedure "manual" mais não adiantou chamar apenas pelo nome: btOkClick;
Assim:
>
procedure TfPesquisar.edPesquisarChange(Sender: TObject);
begin
btOkClick;
end;
Alguem sabe se isso é possivel?
Discussão (4)
Carregando comentários...