This has nothing to do with .NET but with the way VFP behaves and handles MDI windows. You can't really expect an EXTERNAL application to behave as part of a VFP application. This is not what you'd normally want anyway...
I think your particular problem is that you're parenting the window to the VFP window and at runtime there may not be a VFP window. Instead you probably need to parent the app to your application's main window. Still I think this is never going to work as it would for a plain VFP window.
+++ Rick ---
>Hi again, Rick!
>
>I have been playing around with your solution, and it works quite nicely. There is one issue though, that I cannot resolve. Our application is an MDI app, and it would be nice if the .NET form would behave as the native fox forms in that respect.
>
>I am able to confine the form to the main vfp window, by using the SetParent API function. However, in a compiled exe, the form stays on top of the other windows. It seems like the .NET form is aware of what its parent is, vfp does not know of its child.
>
>Any ideas on how to resolve this, and make the .NET form behave like a proper child form?
>
>Thanks,
>
>Eyvind.