MDI Forms... Some unusual request...

  • Thread starter Thread starter Rutko
  • Start date Start date
R

Rutko

Hi

Could I somehow make an MDI Child form in .NET but to have it displayed as
child in another application. I'll try to elaborate. I have application in
Visual FoxPro. In C# I made a little class and use it over COM Interop in
VFP.

Here is the example in C#.....

using System;
using System.Windows.Form;

namespace dotNET
{
public class MyVFPdotNETwrapper
{
private dotNET.Form1 f = null;

public MyVFPdotNETwrapper()
{
this.f = new dotNET.Form1();
}

public void ShowForm()
{
f.Show();
}

......
}
}

And I use it in VFP like this...
dotNetFormWrapper = createobject("dotNET.MyVFPdotNETwrapper)
dotNetFormWrapper.Show()

And it works. Form is displayed, I can use all .NET stuff from VFP, and over
VFP COM I can execute some of my procedures in original VFP application from
..NET. I was wondering can I make that form somehow a child form of my VFP
application. I know it isn't likely it can be done but it would be great.
I'm interested in your ideas and possible solutions (if there is any).

Thx
 
Hi,

What you can probably do is extending the Show method to accept the HWND of
the parent window. Then, when you create a form in your .NET wrapper, use
the passed window handle to make the form being created a child of the VFP
main form.

I'm afraid you'll have to resort to plain WinAPI (namely SetParent) to
establish the parent-child relationship.
 
It works perfectly. Thx.

Dmitriy Lapshin said:
Hi,

What you can probably do is extending the Show method to accept the HWND
of the parent window. Then, when you create a form in your .NET wrapper,
use the passed window handle to make the form being created a child of the
VFP main form.

I'm afraid you'll have to resort to plain WinAPI (namely SetParent) to
establish the parent-child relationship.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

Rutko said:
Hi

Could I somehow make an MDI Child form in .NET but to have it displayed
as child in another application. I'll try to elaborate. I have
application in Visual FoxPro. In C# I made a little class and use it over
COM Interop in VFP.

Here is the example in C#.....

using System;
using System.Windows.Form;

namespace dotNET
{
public class MyVFPdotNETwrapper
{
private dotNET.Form1 f = null;

public MyVFPdotNETwrapper()
{
this.f = new dotNET.Form1();
}

public void ShowForm()
{
f.Show();
}

......
}
}

And I use it in VFP like this...
dotNetFormWrapper = createobject("dotNET.MyVFPdotNETwrapper)
dotNetFormWrapper.Show()

And it works. Form is displayed, I can use all .NET stuff from VFP, and
over VFP COM I can execute some of my procedures in original VFP
application from .NET. I was wondering can I make that form somehow a
child form of my VFP application. I know it isn't likely it can be done
but it would be great. I'm interested in your ideas and possible
solutions (if there is any).

Thx
 
Back
Top