Contents - Index - Top


NavigateSync

Interface AntView 

 

Type: Method

Parameters: String URL Boolean *IsSuccess TxWebErrorStatus *WebErrorStatus

Returns: Integer

 

 

Navigates to the URL passed and loads the document in the WebView2 control.

The navigation process will raise a number of events, starting with the OnNavigationStarting event.

You can see the results of the request in the OnNavigationCompleted event.

Alternatively you can look at the - pass by reference - variables IsSuccess and WebErrorStatus.

IsSuccess is True when the document was correctly loaded, if IsSuccess returns false then you can inspect WebErrorStatus for the reason (see TxWebErrorStatus for details)

 

The function itself returns the following values:

  0 if no errors. 

  21 function is already running (can only run one at a time)

  22 function timed out

  25 Trying to run a synchronous method from within a WebView2 event

 

If navigating the passed URL takes more than 5 seconds, you might want to adjust the time out via SynchronousTimeOut to something else. As SynchronousTimeOut has a default for the AntView interface of 5 seconds.

 

 

This is the Synchronous alternative of the Navigate method.

As the function wraps the async bits, you cannot have the asynchronous variant running when you call this.

Beware that you cannot issue a synchronous call from within an AntView event, with the exception being the OnCreate event.

 

Introduced in AntView release 1.1.236

 


AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/25/2024