MapInfo Pro Developers User Group

Expand all | Collapse all

Simple WinForms app for Mapinfo V17

  • 1.  Simple WinForms app for Mapinfo V17

    Posted 10-27-2019 21:42
      |   view attached
    Firstly I would like to acknowledge Mr. Peter Horsbøll Møller  for his assistance over the last few weeks in resolving my issues.

    If you, like me jumped from the old 32 bit MapInfo environment to V17, then it was quite a leap. Although the examples supplied with the install were good, for me they were too complicated as a learning tool. The biggest piece of knowledge I was missing was on Winforms ElementHost class.

    Once I understood the following it all became easy.

    Every time MapInfo creates a window, in the WindowCreated event, create a Windows control to host it and assign the wpf mapinfo usercontrol to your win forms control. At the same time, store the information in arrays so the links between the Windows forms control and the MapInfo windows are all there for future use. So as further events are triggered, you have the array of required information to display, close, hide etc. win forms controls in accordance with what MapInfo is doing, and vice versa.

    The examples with the install show heaps of functionality.

    Most of the apps I write are far simpler and usually only display a map with limited user interaction, say simple selection only, so the need to accommodate multiple MapInfo windows is not required.

    App.config - set up as per example code and integrated mapping instructions
    References - set up as per example code and integrated mapping instructions

    I hope this assists anyone else out there who is having trouble getting a start.

    ------------------------------
    Paul Thomas
    GIS/Survey Department Officer
    Cook Shire Council
    Cooktown
    ------------------------------

    Attachment(s)



  • 2.  RE: Simple WinForms app for Mapinfo V17

    Posted 10-28-2019 05:12

    Thanks for sharing, Paul.

    I'm glad we were able to make it work. I can not take full credit for this as I got some substantial help from @Bob Fortin​, one of the Software Architects on the MapInfo Pro Engineering team. 



    ------------------------------
    Peter Horsbøll Møller
    Pitney Bowes
    ------------------------------



  • 3.  RE: Simple WinForms app for Mapinfo V17

    Posted 10-28-2019 19:30
    Pls pass on my thanks to Bob Fortin for me!
    Paul Thomas

    ------------------------------
    Paul Thomas
    GIS/Survey Department Officer
    Cook Shire Council
    Cooktown
    ------------------------------