Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invoke button click on Twebbrowser

Status
Not open for further replies.

RyanEK

Programmer
Apr 30, 2001
323
AU
Hi All,

I have a simple form that loads a web page using TWebbrowser. The form has several buttons. Is it possible to do a button click in code?

thanks!
Ryan
 
Ahh I found it...

procedure TForm1.Button4Click(Sender: TObject);
var
ovElements: OleVariant;
i: Integer;
begin
ovElements := WB.OleObject.Document.forms.item(0).elements;
for i := 0 to (ovElements.Length - 1) do
if (ovElements.item(i).tagName = 'INPUT') and
(ovElements.item(i).type = 'SUBMIT') and
(ovElements.item(i).Value = 'Recent Charges') then
ovElements.item(i).Click;

end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top