Sub Class_Globals
Private WebBrowser As WebView
End Sub
Sub GetWebBrowserReference()
'Load my form containing the Web Browser
PageRoot_.RootPanel.LoadLayout("frmBrowser")
Sleep(0) 'Wait for form to finish loading, not sure if this is correct way of doing it??
'Now Look at each control on the form I just loaded in succession.....
For Each v As View In PageRoot_.RootPanel.GetAllViewsRecursive
'If I found a Webview.....
If GetType(v).Trim.ToLowerCase.Contains("webview") = True Then
'....if it Is the one I am looking For, ie. Tag = 'WebBrowser'
If v.Tag = "WebBrowser" Then
'Grab a reference To it.
WebBrowser = v '<<<<<< This line causes the compile error.
'Get out of the Loop.
Exit
End If
End If
Next
End Sub