Alright, after searching long and hard for a fix to the issues with Flash not working properly after a button / link is clicked in the WebBrowser control, here is a fix I have found.
Enjoy.
Enjoy.
This is a known issue of the .NET 2.0 WebBrowser control code. We're sorry
for the inconvenience caused. Here's the workaround for the WebBrowser
code: we need to inherit from the WebBrowser control and override its
WndProc to handle the mouse releated messages:
Public Class MyWebBrowser
Inherits System.Windows.Forms.WebBrowser
Const WM_LBUTTONDOWN As Integer = &H201
Const WM_RBUTTONDOWN As Integer = &H204
Const WM_MBUTTONDOWN As Integer = &H207
Const WM_MOUSEACTIVATE As Integer = &H21
Private Function FindContainerControl() As ContainerControl
Dim cc As ContainerControl = Nothing
Dim ctl As Control = Me
Do While Not ctl Is Nothing
Dim tempCC As ContainerControl = TryCast(ctl, ContainerControl)
If Not tempCC Is Nothing Then
cc = tempCC
Exit Do
End If
ctl = ctl.Parent
Loop
Return cc
End Function
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_MBUTTONDOWN,
WM_MOUSEACTIVATE
If Not DesignMode Then
Dim cc As ContainerControl = FindContainerControl()
If Not cc Is Nothing AndAlso Not cc.ActiveControl Is Me
Then
cc.Focus()
End If
End If
DefWndProc(m)
Case Else
MyBase.WndProc(m)
End Select
End Sub
End Class
I've tested it on my side using this customized WebBrowser control with the
URL you provided, it's working correctly. Please test it on your side and
let me know the result. Thanks.
Sincerely,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support