TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > VB.NET

Notices

VB .net (webbrowser control) How to capture javascript events (statusbar changed/mouseclick etc.)

VB.NET


Reply
 
Thread Tools Display Modes
Old 14-12-2007, 11:27 PM   #1
P-GPS
Guest
 
Posts: n/a
VB .net (webbrowser control) How to capture javascript events (statusbar changed/mouseclick etc.)

Hi,
I am loading a webpage in the "webbrowser" in a VB .NET
application. There are some javascript events which occur when I click
a particular button, or link etc. However, these are AJAX
applications, so on the status bar of a regular internet explorer
browser, I see "DONE" and javascript:void() being displayed before
and after clicking the button/link. The javascript basically changes
the value of a DHTML tag. I want to capture (eventually) the changed
value in the innerText of this DHTML tag.
webbrowser1.DocumentCompleted doesn't help much.
What I would like to do is to be able to capture that there is an
event which occurs. The event may be me pressing/releasing a button
which causes the javascript to run. Howver, once this event occurs, I
want to read this innerText of the DHTML tag.

I am new to VB .NET and may not have put it in the right terms. Let me
know if you need more explanation.

Thanks.
  Reply With Quote
Old 14-12-2007, 11:28 PM   #2
kimiraikkonen
Guest
 
Posts: n/a
Re: VB .net (webbrowser control) How to capture javascript events(status bar changed/mouseclick etc.)

On Dec 14, 6:59 pm, P-GPS <> wrote:
> Hi,
> I am loading a webpage in the "webbrowser" in a VB .NET
> application. There are some javascript events which occur when I click
> a particular button, or link etc. However, these are AJAX
> applications, so on the status bar of a regular internet explorer
> browser, I see "DONE" and javascript:void() being displayed before
> and after clicking the button/link. The javascript basically changes
> the value of a DHTML tag. I want to capture (eventually) the changed
> value in the innerText of this DHTML tag.
> webbrowser1.DocumentCompleted doesn't help much.
> What I would like to do is to be able to capture that there is an
> event which occurs. The event may be me pressing/releasing a button
> which causes the javascript to run. Howver, once this event occurs, I
> want to read this innerText of the DHTML tag.
>
> I am new to VB .NET and may not have put it in the right terms. Let me
> know if you need more explanation.
>
> Thanks.


Add Timer, for example, i was working on that kind of thing which must
update status bar on every status change, then today i added a Timer
which does what you want IIRC. (100ms interval is good by default)

Make timer enabled by default, then put the code inside timer1_tick
area.

For example to retrieve status on a status bar of webbrowser control,
add a status bar then add a timer, then the code must be like this:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
StatusBar1.Text = webbrowser1.StatusText
End Sub

Where "webbrowser1" is your control name.







  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 01:17 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional