2022-08-30, 10:17:06
Hi,
Thank you for your questions.
I will try to answer them below.
When adding the control to a form and docking it horizontally to both sides, the width of all webpages are larger than the form itself. How can we prevent this from happening?
Can you try the following?
For me when I last tested it in MS Access that made the AntView control have the expected width.
In Internet Explorer there was an option to execute commands by calling browser.ExecWB. Is there any equivalent in Antview?
No, sorry, there is no ExecWB for WebView2.
In the WebView2 world everything is handled by Javascript. This opens up a lot more possibilities, but it is quite a mind shift from the old mshtml and ExecWB way of doing things.
is there an easier way to get the html source of the current page? We use it it many places and right now we'll have to execute an event and catch it in another (RequestCurrentHtml). In IE we could simply call browser.document.body
The default way of working with the WebView2/AntView control is asynchronous.
This is the recommended way and is most flexible.
However, as this is sometimes problematic with legacy programming languages we have started on implementing synchronous wrapper functions to make it easier to communicate with the control.
The RequestCurrentHtml function has a synchronous variant RequestCurrentHtmlSync which directly returns the html of the current page.
Can we request the state of the browser? In IE this would be browser.readystate.
This works completely different in WebView2. You would be looking at the OnNavigationCompleted event (or likely the OnNavigationCompletedHex variant as I doubt that MS Access supports Int64 data types) in order to see if a document is completely loaded.
Hope this helps,
--
Wil
Thank you for your questions.
I will try to answer them below.
When adding the control to a form and docking it horizontally to both sides, the width of all webpages are larger than the form itself. How can we prevent this from happening?
Can you try the following?
For me when I last tested it in MS Access that made the AntView control have the expected width.
In Internet Explorer there was an option to execute commands by calling browser.ExecWB. Is there any equivalent in Antview?
No, sorry, there is no ExecWB for WebView2.
In the WebView2 world everything is handled by Javascript. This opens up a lot more possibilities, but it is quite a mind shift from the old mshtml and ExecWB way of doing things.
is there an easier way to get the html source of the current page? We use it it many places and right now we'll have to execute an event and catch it in another (RequestCurrentHtml). In IE we could simply call browser.document.body
The default way of working with the WebView2/AntView control is asynchronous.
This is the recommended way and is most flexible.
However, as this is sometimes problematic with legacy programming languages we have started on implementing synchronous wrapper functions to make it easier to communicate with the control.
The RequestCurrentHtml function has a synchronous variant RequestCurrentHtmlSync which directly returns the html of the current page.
Can we request the state of the browser? In IE this would be browser.readystate.
This works completely different in WebView2. You would be looking at the OnNavigationCompleted event (or likely the OnNavigationCompletedHex variant as I doubt that MS Access supports Int64 data types) in order to see if a document is completely loaded.
Hope this helps,
--
Wil