How to have a VB.Net Form always above a VB6 Form, but not topmost
Posted on 2011-03-03
Question: are there any api’s (or equivalent) which allow a VB.Net Form to be placed always above a VB6 MDI form, but not topmost?
I have a VB6 software program which is integrated with Visual Studio Tools for Applications (VSTA). VSTA allows access to the host’s (VB6) object model, and is Microsoft’s replacement for Visual Basic for Applications (VBA).
I would like the end user to be able to create custom forms within VSTA using VB.Net, and make the VB6 MDI form and the VSTA forms appear as a single form. Basically, the new VB.Net forms would need to always be above the VB6 MDI form, but not topmost.
Currently, I set the VB.Net forms to always on top, but this is not the best solution because the user may need to open additional software. Also, to make it appear as a single form, I use the same color and eliminate the border and caption, thus the end user can not tell that he is using forms on more than one program.
In summary, what code should be run when first opening the VB.Net form so that it is always above the VB6 MDI form. If needed, I can obtain the VB6 form's hwnd.
Your help would be greatly appreciated.