WebView2 Class
The WebView2 class is a form control allows you to duplicate the functionality of Microsoft's Edge browser inside of an EasyLanguage Application. For example, by adding a WebView2 control to a form you can display external web resources and data including news stories and video, interactive tutorials, trading chat room access, and custom dashboards. Additionally, this control will allow you to create HTML commentary, similar to the existing Analysis Commentary, but with much more flexibility and fewer restrictions.
Use of this control follows the same pattern as other EasyLanguage WinForm controls. The control must be created prior to use by calling the Create method. Once created, it can be added to a WinForm using the AddControl method.
The WebView2 control includes features such as navigating to a URL, reloading a web page, and moving backwards and forwards through navigation history. Additionally, navigation, document loading, and other events can be monitored (see the Events section, below).
Namespace: elsystem.windows.forms
|
Name |
Description |
|
Create |
Initializes a new instance of the control. |
|
Create (width,height) |
Initializes a new instance of the control. Parameters
include the Width
and Height of the control. |
|
ExecuteScriptAsync( script ) |
Runs the provided script in the WebView2 control. |
|
GoBack |
Navigates the WebView2 to the previous page in the navigation history, if one is available. |
|
GoForward |
Navigates the WebView2 to the next page in the navigation history, if one is available. |
|
NavigateToString(string) |
Renders the HTML that is provided as a string parameter. Note that the string must be valid HTML, rather than simple text. |
|
Reload |
Reloads the document currently displayed in the WebView2 by checking the server for an updated version. |
|
Stop |
Cancels any pending navigation and stops any dynamic page elements, such as background sounds and animations. |
|
Name |
Description |
|
CoreWebView2InitializationCompleted |
Occurs when the control has finished initialization or when an attempt to initialize the control fails. See WebView2CoreWebView2InitializationCompletedEventArgs for the properties returned by the handler's args parameter. |
|
ExecuteScriptDone |
Occurs when the control completes execution of the script specified in a call to ExecuteScriptAsync(). See ExecuteScriptDoneEventArgs for the properties returned by the handler's args parameter. |
|
NavigationCompleted |
Occurs when the control completes rendering of a document, whether the rendering is successful, or not. See WebView2NavigationCompletedEventArgs for the properties returned by the handler's args parameter. |
|
NavigationStarting |
Occurs when an attempt to navigate to a new document begins. See WebView2NavigationStartingEventArgs for the properties returned by the handler's args parameter. |
|
SourceChanged |
Occurs when the control's Source property changes. See WebView2SourceChangedEventArgs for the properties returned by the handler's args parameter. |
|
WebMessageReceived |
Occurs when web content sends a message to the application host using chrome.webview.PostMessage. See WebView2WebMessageReceivedEventArgs for the properties returned by the handler's args parameter. |
|
ZoomFactorChanged |
Occurs when the control's ZoomFactor property changes. This event does not fire when the ZoomFactor is changed by the code that created the WebView2 control. See EventArgs for the properties returned by the handler's args parameter. |