WebView2
The WebView2 control allows you to host a web browser, including the option for navigation controls, within your applicaton.
The WebView2 control is Microsoft’s .NET interface to the Microsoft Edge browser. WebView2 supports the latest browser technologies.
The WebView2 control can be dragged and dropped like all other controls, and the URL of the website to be displayed is added to the control properties. For example, the following form contains a WebView2 control that has the URL for a page in the Online Help added.
In the above example, buttons have been added in a panel at the left that provide, on click, a new URL for the WebView2 control. This means the buttons in the form will navigate to Google or the Micromine website.
The WebView2 control features Back and Forward options via the right-click shortcut menu. Inside a form, a user can right-click in the web control and select a direction to navigate:
The keyboard shortcuts of Alt + Left arrow (Back) and Alt +Right arrow (Forward) can also be used.
The shortcut menu can also be used to open links from the displayed web page in a new window:
Properties
The key properties for the WebView2 control include:
-
CanGoBack. Enables the webview to navigate to a previous page in the navigation history via the shortcut menu.
-
CanGoForward. Enables the webview to navigate to the next page in the navigation history via the shortcut menu.
-
Dock - Determines the area inside the form to which the WebView2 control is docked. If Fill is selected, the browser will be expanded to fill the space available.
-
AllowExternalDrop - Determines whether the WebView2 element in the form allows drag and drop functionality. Drag and drop can be used to open web addresses and compatible files such as .html and .png for display in a pop up window from the WebView2 control in the form.
-
CoreWebView2. The underlying CoreWebView2. This property can be used to perform additional operations on the WebView2 content than is included by default.
-
Source. The Source property is the URL of the top level page for the WebView2. The Source property must be in the URL format, and can be used to display a website.
-
ZoomFactor. The zoom factor for the WebView2.
Adding a WebView2
When you drag a WebView2 control to a form in the Flow Designer,
The Source URL of the page to be displayed in the control can be added in the Misc section of the Properties pane.
Information on the properties and events for the WebView2 control is available at the link to Microsoft® Documentation.