FocusPreviousObject
Interface AntView
Type: Method
Parameters: none
Returns: nothing
Will move the focus from the AntView object to the object as set by the PreviousFocusWindowHandle property.
This is mainly interesting for Visual FoxPro. The WebView2 control does not trigger the windows LostFocus event when used in VFP. As such it never detects that the focus left the control when you click on another control in your form. So what to do?
The workaround is to set PreviousFocusWindowHandle to mainHwnd() (your form's window handle) and then in the Click event from the control you are navigating towards to call FocusPreviousObject which will then execute a Windows API setfocus to notify the AntView control that it has actually lost the focus.
Introduced in AntView release 1.1.330
AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/30/2024