Previous topicNext topic
Help > Methods >
Init

Init Method

Initializes the control, loads and displays the Webview2, and displays the page defined by the HomeURL property, if it is specified.
Once the initialization is complete, the InitComplete event is launched, and the IsWebViewInit property is set to True.
This function MUST be called before any Internet browsing.

Syntax

object. Init([Lang As String = ""])

The Load method syntax has these parts:

Element Description
Object The object placeholder represents an OrdoWebView2 control
Lang String, optional, Language defined by the 2-letter code from ISO 639. If omitted, the chosen language will be that of the user's system.

Remarks

  • This is the first method that must be called before any use of the control to browse html page.
  • It is important that the host window is visible before calling the init function.
  • You must imperatively wait for the InitComplete event to be fired before starting a navigation (Navigate Method).
        
  • You can use the Visual Basic 6 Navigate2 procedure below to ensure the correct initialization of the control, for example

     Private Sub Navigate2(MyOrdoWebViewControl As OrdoWebView, URI As String)
        Screen.MousePointer = vbHourglass
       
    'Ensures the control is visible before initalization
        'For example :

        MyOrdoWebViewControl.Top = 0 'or any other value in the visible part of the window
        MyOrdoWebViewControl.Left = 0
    'or any other value in the visible part of the window
        MyOrdoWebViewControl.Visible = True
        '
        If MyOrdoWebViewControl.IsWebViewInit = False Then ' control is not initialized
           If URI > "" Then MyOrdoWebViewControl.HomeURL = URI
           MyOrdoWebViewControl.Init
        Else
           If URI > "" Then MyOrdoWebViewControl.Navigate URI
        End If
        Screen.MousePointer = vbArrow
    End Sub