Losing control on SetParented form.
Good Day All -
In an attempt to avoid having to use VB6 UserControls embedded into our top
level form, we are using Forms which are loaded into a UserControl called
PRFormContainer.uclFormContainer. Behind the scenes, this control takes the
form reference, and uses the hWnd property to:
* Set the WS_CHILD style on the form so that it becomes a child window (this
means that the top level form does not lose focus when you set focus onto
the contained form).
* SetParent the form to the top level form (ensuring you save the old form's
* SetWindowPos the form so that it completely fills the UserControl.
This has been working quite nicely up to now, but recently a focus issue
has come up:
After using F1 context help on a text box in the contained form, the help
app appears, but when you go back to the original application, the focus
is now on the first control on the top level window. You have to click once
on the control to activate the top window app, and click once more to get
the control's focus.
Can anybody please give a suggestion as what to do?
Mark Alexander Bertenshaw
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL