Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 8 of 8

MapPoint control and MDI form

This is a discussion on MapPoint control and MDI form within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am using C# 2005 with the MapPoint control from MapPoint 2006. I have 2 forms in a MDI container. ...

  1. #1
    ddsoft is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    2

    MapPoint control and MDI form

    I am using C# 2005 with the MapPoint control from MapPoint 2006. I
    have 2 forms in a MDI container. The sequence I go through is to put
    the MapPoint control on Form1. On the load of the app I show Form1 in
    the MDI container. Then on click I show Form2 (notice I do not hide
    Form1). I then click a button on Form2 to show Form1. When Form1 was
    shown the first time it asked me to save it (which was undesireable
    behavior) so I put this code in the Form1_Deactivate method:
    axMap.ActiveMap.Saved = true;


    Now when I go back to Form1 the control is empty and worse yet the
    ActiveMap == null. How did the control decide to unload my map? How do
    I get around this?
    Any help, links, or pointers appreciated.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: MapPoint control and MDI form

    Hi,

    I dont know direct what is wrong, but it should work. I have a few applications where I create new instances of a form with a mappoint control on it, and show them in parallel.

  3. #3
    ddsoft is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    2

    Re: MapPoint control and MDI form

    are the forms you create in paralell MDIChildren in an MDIContainer? Also, does one form not have a map point control on it?

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: MapPoint control and MDI form

    Hi,

    No, in C# I use SourceForge.net: DockPanel Suite from weifenluo. In Delphi I have MDI forms. All created forms has a control on it at design time.

  5. #5
    Marin is offline Junior Member White Belt
    Join Date
    Apr 2007
    Posts
    6

    Re: MapPoint control and MDI form

    Quote Originally Posted by ddsoft View Post
    I am using C# 2005 with the MapPoint control from MapPoint 2006. I
    have 2 forms in a MDI container. The sequence I go through is to put
    the MapPoint control on Form1. On the load of the app I show Form1 in
    the MDI container. Then on click I show Form2 (notice I do not hide
    Form1). I then click a button on Form2 to show Form1. When Form1 was
    shown the first time it asked me to save it (which was undesireable
    behavior) so I put this code in the Form1_Deactivate method:
    axMap.ActiveMap.Saved = true;


    Now when I go back to Form1 the control is empty and worse yet the
    ActiveMap == null. How did the control decide to unload my map? How do
    I get around this?
    Any help, links, or pointers appreciated.
    I had the same problem. I had to speed up the loading of the map so I loadeda the form when the application started, and then uset Hide() to make it invisible. Well, in that moment MapPoint tryes to be clever and closes the map. So the solution is to set the border to None, and the size to (0,1) so the form becomes virtualy inivisible. Note: when using size (0,0) the application goes crazy and consumes 100% proc power.

    Was this useful?

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: MapPoint control and MDI form

    Quote Originally Posted by Marin View Post
    I had the same problem. I had to speed up the loading of the map so I loadeda the form when the application started, and then uset Hide() to make it invisible. Well, in that moment MapPoint tryes to be clever and closes the map. So the solution is to set the border to None, and the size to (0,1) so the form becomes virtualy inivisible. Note: when using size (0,0) the application goes crazy and consumes 100% proc power.
    I have a few applications where I use the ActiveX control invisible, and I create it in code. No need to put it on a form and this also works. So this looks another approach.

  7. #7
    Marin is offline Junior Member White Belt
    Join Date
    Apr 2007
    Posts
    6

    Re: MapPoint control and MDI form

    Quote Originally Posted by Wilfried View Post
    Hi,

    No, in C# I use SourceForge.net: DockPanel Suite from weifenluo. In Delphi I have MDI forms. All created forms has a control on it at design time.
    I tryed to use DockPanel but when I try to dock a floating window with a MapPoint control, the control closes the map and then the map dissapears. Have you had the same problem?

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: MapPoint control and MDI form

    Hi,

    No I do not have that problem. Very wierd...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mapPoint 2006 activex control slow down form closing
    By bule in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-26-2006, 02:22 PM
  2. the map is empty after Show/Hide form with MapPoint control
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-25-2004, 04:24 PM
  3. Alignment of the control on my form
    By blackmap in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-25-2003, 02:43 AM
  4. MapPoint Control align in Form
    By blackmap in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-06-2003, 11:26 AM
  5. MapPoint OCX control does not work on a .Net MDI form.
    By clackclack in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 12-06-2002, 12:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96