Skip to content

cWebView2Host Properties Reference ​

📋 Properties Overview ​

CategoryPropertyTypeAccessDescription
StateIsReadyBooleanRead-onlyWhether WebView2 is ready
hWndLongPtrRead-onlyWebView2 child window handle
BrowserProcessIdLongRead-onlyBrowser process ID
CanGoBackBooleanRead-onlyWhether backward navigation is available
CanGoForwardBooleanRead-onlyWhether forward navigation is available
IsSuspendedBooleanRead-onlyWhether process is suspended
IsMutedBooleanRead-onlyWhether page is muted
IsDocumentPlayingAudioBooleanRead-onlyWhether page is playing audio
IsDefaultDownloadDialogOpenBooleanRead-onlyWhether download dialog is open
DocumentDocumentURLStringRead-onlyCurrent document URL
DocumentTitleStringRead-onlyCurrent document title
ZoomFactorDoubleRead/WriteZoom factor
SettingsIsScriptEnabledBooleanRead/WriteWhether JavaScript is enabled
AreDevToolsEnabledBooleanRead/WriteWhether DevTools is enabled
IsStatusBarEnabledBooleanRead/WriteWhether status bar is visible
IsZoomControlEnabledBooleanRead/WriteWhether user zoom is allowed
AreDefaultContextMenusEnabledBooleanRead/WriteWhether context menus are enabled
UserAgentStringRead/WriteCustom User-Agent
IsPinchZoomEnabledBooleanRead/WriteWhether pinch zoom is enabled
IsSwipeNavigationEnabledBooleanRead/WriteWhether swipe navigation is enabled
IsPasswordAutoSaveEnabledBooleanRead/WriteWhether password auto-save is enabled
IsGeneralAutoFillEnabledBooleanRead/WriteWhether auto-fill is enabled
AreBrowserAcceleratorKeysEnabledBooleanRead/WriteWhether browser accelerator keys are enabled
Feature DetectionSupports* (8)BooleanRead-onlyInterface version support status
Sub-objectsCookiescWebView2CookiesRead-onlyCookie management object
ScriptcWebView2ScriptRead-onlyScript execution object
SecuritycWebView2SecurityRead-onlySecurity management object
EnvironmentOptionscWebView2EnvironmentOptionsRead-onlyEnvironment options object
AdapterHostAdapterNameStringRead-onlyCurrent host adapter name
Mouse EventsEnableUserMouseEventsBooleanRead/WriteWhether content area mouse events are enabled
EnableUserMouseMoveBooleanRead/WriteWhether mousemove events are enabled
EnableMouseMoveEventsBooleanRead/WriteWhether 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:

vb
If wv.IsReady Then
    wv.Navigate "https://example.com"
End If

hWnd ​

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:

vb
If wv.CanGoBack Then wv.GoBack

IsSuspended ​

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:

vb
Debug.Print "Current URL: " & wv.DocumentURL

DocumentTitle ​

The title of the current document.

Type: String
Access: Read-only

Note: Typically read in the DocumentTitleChanged event to update the form caption.

Example:

vb
Private Sub wv_DocumentTitleChanged()
    Me.Caption = wv.DocumentTitle
End Sub

ZoomFactor ​

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:

vb
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:

vb
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:

PropertyCorresponding InterfaceDescription
SupportsWebView2ICoreWebView2Base interface (always True)
SupportsWebView3ICoreWebView2_3DOMContentLoaded, etc.
SupportsWebView4ICoreWebView2_4Suspend/Resume
SupportsWebView5ICoreWebView2_5Folder mapping
SupportsWebView6ICoreWebView2_6DownloadStarting
SupportsWebView7ICoreWebView2_7PrintToPdf
SupportsWebView8ICoreWebView2_8Audio
SupportsWebView9ICoreWebView2_9DownloadDialog

Type: Boolean
Access: Read-only

Example:

vb
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:

vb
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:

vb
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:

vb
' Must be configured in the wv_Create event
Private Sub wv_Create()
    wv.Security.CertificateErrorAction = CEA_AlwaysAllow
End Sub

EnvironmentOptions ​

WebView2 environment options object.

Type: cWebView2EnvironmentOptions
Access: Read-only

Properties:

Sub-propertyTypeDescription
BrowserExecutableFolderStringBrowser executable folder
UserDataFolderStringUser data folder path
AdditionalBrowserArgumentsStringAdditional browser command-line arguments
LanguageStringBrowser language
TargetCompatibleBrowserVersionStringTarget compatible browser version
AllowSingleSignOnUsingOSPrimaryAccountBooleanWhether to allow OS primary account SSO
ExclusiveUserDataFolderAccessBooleanWhether to exclusively access the user data folder
EnableTrackingPreventionBooleanWhether to enable tracking prevention

Note: UserDataFolder and AdditionalBrowserArguments must be set in the wv_Create event.

Example:

vb
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:

vb
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

VB6 and LOGO copyright of Microsoft Corporation