cWebView2Host Properties Reference
📋 Properties Overview
| Category | Property | Type | Access | Description |
|---|---|---|---|---|
| State | IsReady | Boolean | Read-only | Whether WebView2 is ready |
| hWnd | LongPtr | Read-only | WebView2 child window handle | |
| BrowserProcessId | Long | Read-only | Browser process ID | |
| CanGoBack | Boolean | Read-only | Whether backward navigation is available | |
| CanGoForward | Boolean | Read-only | Whether forward navigation is available | |
| IsSuspended | Boolean | Read-only | Whether process is suspended | |
| IsMuted | Boolean | Read-only | Whether page is muted | |
| IsDocumentPlayingAudio | Boolean | Read-only | Whether page is playing audio | |
| IsDefaultDownloadDialogOpen | Boolean | Read-only | Whether download dialog is open | |
| Document | DocumentURL | String | Read-only | Current document URL |
| DocumentTitle | String | Read-only | Current document title | |
| ZoomFactor | Double | Read/Write | Zoom factor | |
| Settings | IsScriptEnabled | Boolean | Read/Write | Whether JavaScript is enabled |
| AreDevToolsEnabled | Boolean | Read/Write | Whether DevTools is enabled | |
| IsStatusBarEnabled | Boolean | Read/Write | Whether status bar is visible | |
| IsZoomControlEnabled | Boolean | Read/Write | Whether user zoom is allowed | |
| AreDefaultContextMenusEnabled | Boolean | Read/Write | Whether context menus are enabled | |
| UserAgent | String | Read/Write | Custom User-Agent | |
| IsPinchZoomEnabled | Boolean | Read/Write | Whether pinch zoom is enabled | |
| IsSwipeNavigationEnabled | Boolean | Read/Write | Whether swipe navigation is enabled | |
| IsPasswordAutoSaveEnabled | Boolean | Read/Write | Whether password auto-save is enabled | |
| IsGeneralAutoFillEnabled | Boolean | Read/Write | Whether auto-fill is enabled | |
| AreBrowserAcceleratorKeysEnabled | Boolean | Read/Write | Whether browser accelerator keys are enabled | |
| Feature Detection | Supports* (8) | Boolean | Read-only | Interface version support status |
| Sub-objects | Cookies | cWebView2Cookies | Read-only | Cookie management object |
| Script | cWebView2Script | Read-only | Script execution object | |
| Security | cWebView2Security | Read-only | Security management object | |
| EnvironmentOptions | cWebView2EnvironmentOptions | Read-only | Environment options object | |
| Adapter | HostAdapterName | String | Read-only | Current host adapter name |
| Mouse Events | EnableUserMouseEvents | Boolean | Read/Write | Whether content area mouse events are enabled |
| EnableUserMouseMove | Boolean | Read/Write | Whether mousemove events are enabled | |
| EnableMouseMoveEvents | Boolean | Read/Write | Whether host mousemove events are enabled |
📊 State Properties
IsReady
Whether the WebView2 control is fully ready and can accept API calls.
Type: Boolean
Access: Read-only
Example:
If wv.IsReady Then
wv.Navigate "https://example.com"
End IfhWnd
The handle of the WebView2 child window (Chrome_WidgetWin_0).
Type: LongPtr
Access: Read-only
BrowserProcessId
The ID of the browser rendering process.
Type: Long
Access: Read-only
CanGoBack / CanGoForward
Whether backward/forward navigation is available.
Type: Boolean
Access: Read-only
Example:
If wv.CanGoBack Then wv.GoBackIsSuspended
Whether the WebView2 rendering process is suspended.
Type: Boolean
Access: Read-only
IsMuted
Whether page audio is muted.
Type: Boolean
Access: Read-only
IsDocumentPlayingAudio
Whether the current page is playing audio.
Type: Boolean
Access: Read-only
IsDefaultDownloadDialogOpen
Whether the default download dialog is open.
Type: Boolean
Access: Read-only
📝 Document Properties
DocumentURL
The URL of the current document.
Type: String
Access: Read-only
Example:
Debug.Print "Current URL: " & wv.DocumentURLDocumentTitle
The title of the current document.
Type: String
Access: Read-only
Note: Typically read in the DocumentTitleChanged event to update the form caption.
Example:
Private Sub wv_DocumentTitleChanged()
Me.Caption = wv.DocumentTitle
End SubZoomFactor
Page zoom factor.
Type: Double
Access: Read/Write
Note: Default value is 1.0. Setting to 0.5 means 50%, 2.0 means 200%.
Example:
wv.ZoomFactor = 1.5 ' 150% zoom
Debug.Print "Current zoom: " & wv.ZoomFactor⚙️ Settings Properties
IsScriptEnabled
Whether JavaScript execution is enabled.
Type: Boolean
Access: Read/Write
Default: True
Note: When disabled, all JavaScript on the page will not execute.
AreDevToolsEnabled
Whether users can open DevTools (F12).
Type: Boolean
Access: Read/Write
Default: True
Note: Set to False in production to prevent users from debugging pages.
IsStatusBarEnabled
Whether the browser status bar is visible.
Type: Boolean
Access: Read/Write
Default: False
IsZoomControlEnabled
Whether users can zoom the page via Ctrl+scroll wheel, etc.
Type: Boolean
Access: Read/Write
Default: True
AreDefaultContextMenusEnabled
Whether WebView2's default right-click context menu is enabled.
Type: Boolean
Access: Read/Write
Default: True
Note: Set to False if you handle the context menu yourself.
UserAgent
Custom User-Agent string.
Type: String
Access: Read/Write
Note: Once set, all subsequent requests will use this User-Agent. Set to empty string to restore default.
Example:
wv.UserAgent = "Mozilla/5.0 (Custom App)"IsPinchZoomEnabled
Whether touchscreen pinch zoom is enabled.
Type: Boolean
Access: Read/Write
Default: True
IsSwipeNavigationEnabled
Whether touchscreen swipe navigation (forward/backward) is enabled.
Type: Boolean
Access: Read/Write
Default: True
IsPasswordAutoSaveEnabled
Whether password auto-save prompts are enabled.
Type: Boolean
Access: Read/Write
Default: False
IsGeneralAutoFillEnabled
Whether form auto-fill is enabled.
Type: Boolean
Access: Read/Write
Default: False
AreBrowserAcceleratorKeysEnabled
Whether browser accelerator keys (e.g., Ctrl+F search, Ctrl+P print) are enabled.
Type: Boolean
Access: Read/Write
Default: True
Note: Set to False if you don't want users to trigger browser built-in features via keyboard shortcuts.
🔍 Feature Detection Properties
8 Supports* read-only properties for detecting whether the current WebView2 Runtime supports specific version interfaces:
| Property | Corresponding Interface | Description |
|---|---|---|
SupportsWebView2 | ICoreWebView2 | Base interface (always True) |
SupportsWebView3 | ICoreWebView2_3 | DOMContentLoaded, etc. |
SupportsWebView4 | ICoreWebView2_4 | Suspend/Resume |
SupportsWebView5 | ICoreWebView2_5 | Folder mapping |
SupportsWebView6 | ICoreWebView2_6 | DownloadStarting |
SupportsWebView7 | ICoreWebView2_7 | PrintToPdf |
SupportsWebView8 | ICoreWebView2_8 | Audio |
SupportsWebView9 | ICoreWebView2_9 | DownloadDialog |
Type: Boolean
Access: Read-only
Example:
If wv.SupportsWebView5 Then
wv.SetVirtualHostNameToFolderMapping "myapp.local", App.Path & "\www"
End If🔗 Sub-Object Properties
Cookies
Cookie management business object.
Type: cWebView2Cookies
Access: Read-only
Note: Provides GetCookies and GetCookiesFull methods.
Example:
Dim simple As String
simple = wv.Cookies.GetCookies ' Simple cookie list
Dim full As String
full = wv.Cookies.GetCookiesFull ' Full cookie details (including HttpOnly)Script
Script execution business object.
Type: cWebView2Script
Access: Read-only
Note: Provides the Eval method for synchronous JavaScript expression evaluation.
Example:
Dim html As String
html = wv.Script.Eval("return document.querySelector('.title').innerHTML")Security
Security/certificate management business object.
Type: cWebView2Security
Access: Read-only
Note: Provides the CertificateErrorAction property to control certificate error handling behavior. Must be set before Initialize takes effect.
Example:
' Must be configured in the wv_Create event
Private Sub wv_Create()
wv.Security.CertificateErrorAction = CEA_AlwaysAllow
End SubEnvironmentOptions
WebView2 environment options object.
Type: cWebView2EnvironmentOptions
Access: Read-only
Properties:
| Sub-property | Type | Description |
|---|---|---|
BrowserExecutableFolder | String | Browser executable folder |
UserDataFolder | String | User data folder path |
AdditionalBrowserArguments | String | Additional browser command-line arguments |
Language | String | Browser language |
TargetCompatibleBrowserVersion | String | Target compatible browser version |
AllowSingleSignOnUsingOSPrimaryAccount | Boolean | Whether to allow OS primary account SSO |
ExclusiveUserDataFolderAccess | Boolean | Whether to exclusively access the user data folder |
EnableTrackingPrevention | Boolean | Whether to enable tracking prevention |
Note: UserDataFolder and AdditionalBrowserArguments must be set in the wv_Create event.
Example:
Private Sub wv_Create()
wv.EnvironmentOptions.UserDataFolder = App.Path & "\UserDir\account-001"
End Sub🖥️ Adapter Properties
HostAdapterName
The name of the currently used host adapter.
Type: String
Access: Read-only
Values:
"HostSubclassAdapter"- Subclassing adapter (VB6/Excel)"MessageWindowAdapter"- Message window adapter (Access)
Example:
Debug.Print "Adapter: " & wv.HostAdapterName🖱️ Mouse Event Properties
EnableUserMouseEvents
Whether to enable content area user mouse events (UserMouse* events triggered via JS proxy).
Type: Boolean
Access: Read/Write
Default: False
Note: When enabled, mouse events in the WebView2 content area are synchronously called back to the host via the mouseProxy COM object, triggering UserMouseDown, UserMouseUp, UserMouseMove, UserMouseWheel, UserContextMenu, UserDblClick events.
EnableUserMouseMove
Whether to enable content area mousemove events (only effective when EnableUserMouseEvents is True).
Type: Boolean
Access: Read/Write
Default: False
Note: mousemove events fire at extremely high frequency and are disabled by default to avoid performance issues. Enable only when needed (e.g., drag operations).
EnableMouseMoveEvents
Whether to enable host window mousemove events (HostMouseMove).
Type: Boolean
Access: Read/Write
Default: False
Note: Host mouse move events fire at extremely high frequency and are disabled by default to avoid performance issues.
Last Updated: 2026-06-24