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.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-08-28 11:00:00 +0000
Seen: 9 times
Last updated: Jan 28 '22
How to invoke an IIFE declared in the parent window from an IFrame within Dynamics CRM?
Why does the fixed position interfere with the functionality of overflow hidden?
How can notifications for changes in nested properties of a Realm object be implemented?
In Django, why are the fields from the parent class not included in the table of the child class?
How can I make a div occupy the rest of the height of its parent div using Tailwind CSS?
What is the method to prevent the maven-site-plugin from checking the parent project?
Why does the parent persist data by inserting instead of updating when using InheritanceType.JOINED?