|
-
Mar 31st, 2006, 06:53 AM
#1
Thread Starter
Hyperactive Member
webbrowser control
Am just starting to use a web browser control.
I've added some handlers like so
VB Code:
Private Sub AxWebBrowser1_DocumentComplete(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles AxWebBrowser1.DocumentComplete
Dim doc As mshtml.HTMLDocument
doc = CType(AxWebBrowser1.Document, mshtml.HTMLDocument)
Dim iEvent As mshtml.HTMLDocumentEvents2_Event
iEvent = CType(doc, mshtml.HTMLDocumentEvents2_Event)
AddHandler iEvent.onclick, AddressOf ClickEventHandler
AddHandler iEvent.onmouseover, AddressOf MouseOverEventHandler
AddHandler iEvent.onmouseout, AddressOf MouseoutEventHandler
End Sub
These fire the following fine
VB Code:
Private Sub MouseoutEventHandler(ByVal e As mshtml.IHTMLEventObj)
Me.Timer2.Enabled = True
End Sub
Private Sub entform()
If Me.Opacity < 1.0 Then
Me.Opacity = 1.0
End If
Me.Timer2.Enabled = False
End Sub
Private Sub MouseOverEventHandler(ByVal e As mshtml.IHTMLEventObj)
entform()
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If Me.Opacity > 0.2 Then
Me.Opacity = Me.Opacity - 0.01
Else
Me.Timer2.Enabled = False
End If
End Sub
But after about 2minutes the MouseOverEventHandler stops working. Why would this be, and how do I stop this happening.
-
Mar 31st, 2006, 02:36 PM
#2
Frenzied Member
Re: webbrowser control
MouseOverEventHandler calls entform which clearly stops the timer. Your code stops it.
Just because the mouse goes over something, don't expect that it will ever leave it. You can Alt-Tab away from the program, move the mouse, and then Alt-Tab back. In this case, the mouse out will never fire.
~Peter

-
Apr 3rd, 2006, 06:20 AM
#3
Thread Starter
Hyperactive Member
Re: webbrowser control
No I'm testing this program so the mouse is leaving and entering the form. When the mouse leaves the form it slowly becomes transparent, each time the timer fires it becomes that little bit more transparent.
When the mouse renters the form it becomes solid again.
This all works fine for the first minute or so, but at some point the MouseOverEventHandler stops firing, even though I am moving the mouse over the form. This only seems to be an issue with the mouse over of the web control, as it works fine for other controls.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|