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 2 of 2

the map is empty after Show/Hide form with MapPoint control

This is a discussion on the map is empty after Show/Hide form with MapPoint control within the MapPoint Desktop Discussion forums, part of the Map Forums category; In the C# Console Application project I have to hide and show form with MapPoint Control on it. I have ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    the map is empty after Show/Hide form with MapPoint control

    In the C# Console Application project I have to hide and show form with MapPoint Control on it. I have to be able to hide and show a form without closing and saving map every time. Calling the Form.Hide() method causes the MapPoint control loose a map and move control to the UNINITIALIZED state.

    The code from the console application:

    Form1 MapFormInst;
    MapFormInst = new Form1();
    //MapFormInst.ShowDialog(); //if I uncomment this line the next line causes the exception
    MapFormInst.axMappointControl1.NewMap(MapPoint.Geo MapRegion.geoMapNorthAmerica);
    MapFormInst.ShowDialog(); //shows a map
    // calling the Form.Hide() by ckicking the Hide button on the from
    MapFormInst.ShowDialog(); //doesn't show a map

    If I try to hide and show control while form is visible. It works fine. However if I try to close a map and open a new one while MapPointControl is invisible it causes the exception with the message that to perform that method (NewMap) the MapPointControl has to be in the available state. Is the MapPoint Control was developed this way the it has to open,save and close a map every time when you have to show and hide the form? Do you have any other suggestions how to hide a form instead of using Form.Hide() method?

  2. #2
    arsenic77 is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    5

    Re: the map is empty after Show/Hide form with MapPoint cont

    I have the same problem.

    The long initializing time of the NewMap method obligates me to let my Form always open. So I have to use the Hide methode of the Form (or Form.Visible = False) but the mappoint control move alway to the UNINITIALIZED State. This cause a lot of errors (nothing with the control work) and try to do the NewMap method again cause an error too.

    Someone knows how to keep the Control Initisalized although the form is hide then show?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Show or Hide Places
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-24-2004, 10:19 AM
  2. Show or Hide Places
    By Anonymous in forum Wish List
    Replies: 0
    Last Post: 04-24-2004, 10:11 AM
  3. show/hide places
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-06-2003, 10:36 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