Best regards / Med venlig hilsen Lars I. Nielsen GIS & DB Integrator GisPro
--
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To post to this group, send email to mapi...@googlegroups.com.
To unsubscribe from this group, send email to mapinfo-l+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mapinfo-l?hl=en.
You can re-parent the whole MapInfo Pro application window if you
wish, however I am not sure when you would want to do this and might
give a bad user experience if done wrong.
But if you really want to do it then here is some C# code that will
work(just tested it), first add a picture box to your form then add
this code somewhere:
==CODE====
[DllImport("User32", CharSet = CharSet.Auto, ExactSpelling = true)]
internal static extern IntPtr SetParent(IntPtr hWndChild, IntPtr
hWndParent);
public void DoIt()
{
// Start MapInfo.
MapInfoApplication mapinfo = new MapInfoApplication();
// Get the handle
string handle = mapinfo.Eval("SystemInfo(9)");
IntPtr oldhandle = new IntPtr(Convert.ToInt32(handle));
mapinfo.Visible = true;
// Set the parent to the picture box.
SetParent(oldhandle, this.pictureBox1.Handle);
}
==END CODE===
the result should look something like this:
Hope this helps.
Nathan
I have posted this information on my blog, so it is a bit easier for
people to find it later if needed:
http://woostuff.wordpress.com/2010/02/19/embedding-the-whole-mapinfo-application-in-a-net-form/
Regards,
Nathan
> > On Tue, Feb 16, 2010 at 8:41 AM, Nathan Woodrow <madman...@gmail.com>wrote:
>
> >> Hank,
>
> >> You can re-parent the whole MapInfo Pro application window if you
> >> wish, however I am not sure when you would want to do this and might
> >> give a bad user experience if done wrong.
>
> >> But if you really want to do it then here is some C# code that will
> >> work(just tested it), first add a picture box to your form then add
> >> this code somewhere:
>
> >> ==CODE====
>
> >> [DllImport("User32", CharSet = CharSet.Auto, ExactSpelling = true)]
> >> internal static extern IntPtr SetParent(IntPtr hWndChild, IntPtr
> >> hWndParent);
>
> >> public void DoIt()
> >> {
> >> // Start MapInfo.
> >> MapInfoApplication mapinfo = new MapInfoApplication();
> >> // Get the handle
> >> string handle = mapinfo.Eval("SystemInfo(9)");
> >> IntPtr oldhandle = new IntPtr(Convert.ToInt32(handle));
> >> mapinfo.Visible = true;
> >> // Set the parent to the picture box.
> >> SetParent(oldhandle, this.pictureBox1.Handle);
> >> }
>
> >> ==END CODE===
>
> >> the result should look something like this:
>
> >>http://mapinfo-l.googlegroups.com/web/Re-parented%20whole%20MapInfo%2...
>
> >> Hope this helps.
> >> Nathan
>
> >> On Feb 15, 3:45 pm, Hank Finley <asse...@gmail.com> wrote:
> >> > Hi,
>
> >> > just checking out the user guide, and it says you can embed a map into
> >> an
> >> > external program, just curious whether it is possible to embed the
> >> actual
> >> > application window so as you when you want to, you can view table
> >> browsers,
> >> > maps, etc. Or is it that you can create a container then add these
> >> different
> >> > windows to it?
> >> > If it is the later, can you still minimize, maximize and shift these sub
> >> > windows as you would in MapInfo?
>
> >> > Thanks Hank
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "MapInfo-L" group.
> >> To post to this group, send email to mapi...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> mapinfo-l+...@googlegroups.com<mapinfo-l%2Bunsubscribe@googlegroups .com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/mapinfo-l?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "MapInfo-L" group.
> > To post to this group, send email to mapi...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mapinfo-l+...@googlegroups.com<mapinfo-l%2Bunsubscribe@googlegroups .com>