To modify the parent window of a UserForm using VBA, the following steps can be followed:
Dim uf As UserForm
Set uf = UserForm1
uf.ShowModal = False
Dim hwndParent As Long
hwndParent = uf.hwnd
Dim hwndNewParent As Long
hwndNewParent = FindWindow("Notepad", vbNullString)
SetParent hwndParent, hwndNewParent
In this example, the parent window of the UserForm will be set to the Notepad window.
Asked: 2022-08-28 11:00:00 +0000
Seen: 11 times
Last updated: Jan 28 '22