Community of VE/MapPoint Users and Developers
This is a discussion on Answer: How to show mappoint toolbars with C# within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I've spent a lot of time google searching for this answer without any luck (even browsing past messages here), but ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Answer: How to show mappoint toolbars with C# assuming axMappointControl is your control, and you want to show the navigation bar, then use this code: Code: object barObj = "navigation"; this.axMappointControl.Toolbars.get_Item(ref barObj).Visible = true; the idea of using get_Item comes from here: http://mp2kmag.com/a103--chandu.thot....mappoint.html What I don't understand is the get_Item function doesn't even show up in the class... no wonder something like this can be fustrating... when there are hidden class functions! Surprisingly, as far as my google searching skills are concerned, I am the first person to have figured this out. I hope my google searching skills are just bad, rather than have this dubious honor. Can support for mappoint in C# be this bad? I thought C# was a first class language in the eyes of Microsoft. I would prefer if Microsoft would not support MapPoint for C# at all, rather than giving me the impression that, since there exists a component for C#, and it's a Microsoft product, it must be fully functional. If there was no component in C#, then I'd have learn VB instead. I resist learning VB because I come from a C++ background and like the familiarity. The things I learn through trial and error. Sorry if this sounds like a rant... it's just that I've spent a lot of time trying to figure this out. [/code] |
| |||
|
Nice, I have another problem. I cant adjust the preferred arrival and departure times of a waypoint. I always get the message "Access Denied" (also posted here) I tried with a IEnumerator, foreach,... Only with the get_Item() I dont know what object I need to give. The example in msdn is something like Control.ActiveMap.ActiveRoute.Waypoints(.Items??? not sure).Prefered... = time; If I do it this way it wont work in C#. |
| |||
|
one thing you might do to make life easier on yourself is use the waypoint class, so you can play with the waypoint object that is returned when you add a location/pushpin to a stop. like so: Code: MapPoint.Waypoint way = route.Waypoints.Add(location, nameOfStop); way.PreferredDeparture.AddHours(1); Code: way.PreferredDeparture = System.DateTime.Parse("4/14/04");
|
| |||
|
Something is wrong, I did the following: Code: way = ActiveMap.ActiveRoute.Waypoints.Add(pin,locationarray[i].Name); MessageBox.Show(this, way.PreferredArrival.ToLongTimeString()); way.PreferredArrival.AddHours(5); MessageBox.Show(this, way.PreferredArrival.ToLongTimeString()); way.PreferredArrival.AddMinutes(Convert.ToDouble(preferredarrivalarray[i].Minute)); way.PreferredArrival.AddSeconds(Convert.ToDouble(preferredarrivalarray[i].Second)); |
| |||
|
when i have an extra moment i'll see if i can help you out in the meantime, i found a way to get the current selection on a map in C# Code: private void axMappointControl1_SelectionChange(object sender, AxMapPoint._IMappointCtrlEvents_SelectionChangeEvent e)
{
MapPoint.Pushpin pin = null;
pin = (MapPoint.Pushpin) curMap.Selection;
MessageBox.Show(pin.Name);
}
|
![]() |
| Tags |
| answer, mappoint, show, toolbars |
| ||||
| Posted By | For | Type | Date | |
| lewinmadrid's MapPoint Bookmarks on Delicious | This thread | Refback | 09-11-2008 10:26 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Locking mappoint toolbars | Varrus | MapPoint 2006/2009 Discussion | 1 | 05-11-2006 04:12 PM |
| Nobody knows the answer? How to retrieve the name of country | Abilio Serafim | MapPoint 2006/2009 Discussion | 1 | 04-29-2005 11:09 AM |
| Show toolbars in Control | Anonymous | MapPoint 2006/2009 Discussion | 4 | 11-19-2004 03:04 PM |
| PLZ... answer me coz am very very new ! | tracking_sys | MapPoint 2006/2009 Discussion | 0 | 01-28-2004 02:43 AM |
| 27/10/01 Thanks for your previous answer but the .... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-27-2001 12:42 AM |