Contents - Index - Top


OnCreateWebViewCompleted

Interface AntView 

 

Type: Event

Parameters: Int HResult

 

 

Is called after the process to create the WebView2 control on screen has finished.

The parameter HResult contains the windows status if it could not succeed or S_OK (= 0) if it succeeded.

See Common HRESULT Values for some examples.

 

The order of events during creation of the WebView2 control is:

- OnCreate

- OnActivate

- OnCreateWebviewCompleted

 

Here's a VB6 example where the control will automatically navigate to a string on creation complete:

 

Private Sub EdgeWebBrowser_OnCreateWebviewCompleted(ByVal HResult As Long)

  Dim Html As String

  Dim TextLine As String

  Dim HtmlFile As String

  Dim Path As String

  

  If HResult = 0 Then

    ' Load the html from file flipCard3D.html

    Path = strGetVisualBasicDemoPath

    HtmlFile = Path & "\html\flipCard3D.html"

    Open HtmlFile For Input As #1

    Do Until EOF(1)

      Line Input #1, TextLine

      Html = Html & TextLine

    Loop

    Close #1

    

    EdgeWebBrowser.NavigateToString Html

  End If

End Sub

 

See also:

VB6 - Load html as string example

 


AntView - The MS Edge WebView2 ActiveX control Date last changed: 04/16/2025