 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
viana Guest
|
Posted: Tue May 15, 2007 4:48 am Post subject: Click in a button on TWebBrowser |
|
|
Hello,
Is there a way to simulate a click in a button in a page loaded by TWebBrowser ? I know i can simulate the mouse click, but i'd like to simulate the click in the button without positioning the mouse in this button.
Thanks,
Viana |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue May 15, 2007 4:54 am Post subject: Re: Click in a button on TWebBrowser |
|
|
"viana" <v (AT) v (DOT) com> wrote in message
news:4648f55b$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Is there a way to simulate a click in a button in a
page loaded by TWebBrowser ?
|
Yes. After the page has been loaded, you can query the browser's
Document property for the IHTMLDocument2 interface, drill through the
DOM interfaces until you find the button you are interested in, query
it for the IHTMLElement interface, and then call its click() method.
Refer to MSDN for more details:
Interfaces and Scripting Objects
http://msdn2.microsoft.com/en-us/library/Aa741322.aspx
IHTMLDocument2 Interface
http://msdn2.microsoft.com/en-us/library/aa752574.aspx
Go to http://www.deja.com and search through the newsgroup archives
for examples that have been posted many times before.
Gambit |
|
| Back to top |
|
 |
Eddie Shipman Guest
|
Posted: Tue May 15, 2007 7:00 pm Post subject: Re: Click in a button on TWebBrowser |
|
|
viana wrote:
| Quote: |
Hello,
Is there a way to simulate a click in a button in a page loaded by
TWebBrowser ? I know i can simulate the mouse click, but i'd like to
simulate the click in the button without positioning the mouse in
this button.
|
Well, first off, you cannot use mouse messages with TWebBrowser to
click on a button.
Second, if the button submits a form, it is much easier to use the
syntax: document.forms['formname'].submit .vs clicking the button
through the DOM.
-- |
|
| Back to top |
|
 |
viana Guest
|
Posted: Tue May 15, 2007 9:46 pm Post subject: Re: Click in a button on TWebBrowser |
|
|
thank you guys for your answers.
i've got a solution thanks to you :)
"Eddie Shipman" <mr_delphi_developer (AT) nospamyahoo (DOT) com> wrote:
| Quote: | viana wrote:
Hello,
Is there a way to simulate a click in a button in a page loaded by
TWebBrowser ? I know i can simulate the mouse click, but i'd like to
simulate the click in the button without positioning the mouse in
this button.
Well, first off, you cannot use mouse messages with TWebBrowser to
click on a button.
Second, if the button submits a form, it is much easier to use the
syntax: document.forms['formname'].submit .vs clicking the button
through the DOM.
--
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|