### Copy selection to clipboard

Example copying text selected in the WebView to the clipboard.
This solution uses API methods (requires the JavaObject library).
Dim WebView_DyK as WebView
Dim joWV As JavaObject
Dim joWE As JavaObject
'Assign the webview to the JavaObject
joWV = WebView_DyK
'Get the webengine from the webview using method getEngine
Dim joWE As JavaObject = joWV.RunMethod("getEngine", Null)
'Set javascript enabled for the webengine
joWE.RunMethod("setJavaScriptEnabled", Array(True))
'Execute script
Dim s As String = joWE.RunMethod("executeScript", Array("window.getSelection().toString();"))
'Copy the string to the clipboard
fx.Clipboard.SetString(s)

Changed: 2018-05-03 08:50, Category: WebView, File: T6C284M2169.htm, ID: 2169