Community of VE/MapPoint Users and Developers
This is a discussion on Still stuck on the freeform event! within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello people, Can anyone say why I always get type 1 returned with in this doubleclick event...I am trying to ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Can anyone say why I always get type 1 returned with in this doubleclick event...I am trying to draw a freeform on the map and then catch it as such with the event...the type should be 5 (freeform)..but is always 1 thanks.. PrivateSub AxMappointControl1_BeforeDblClick1(ByVal sender AsObject, ByVal e As AxMapPoint._IMappointCtrlEvents_BeforeDblClickEven t) Handles AxMappointControl1.BeforeDblClick Dim omap As MapPoint.Map omap = AxMappointControl1.ActiveMap MsgBox("The type of this shape is: " _ + CStr(omap.Shapes.Item(1).Type)) If omap.Selection IsNothingThen Stop EndIf EndSub |
| |||
| Re: Still stuck on the freeform event!
Hi, Please do not double post. If you think your original post is not seen then you can reply to it and it will move back to top and will be set not read. Are you sure there is not another shape on your map ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Still stuck on the freeform event!
Thanks Wilfried... I am working with a new clean map with no other shapes. I have the same difficulty with the following code, that is, when doubleclicking on a shape on the map the code fires, but never finds a shape object..thanks for any help. PrivateSub AxMappointControl1_BeforeDblClick(ByVal sender AsObject, ByVal e As AxMapPoint._IMappointCtrlEvents_BeforeDblClickEven t) Handles AxMappointControl1.BeforeDblClick Dim searche As MapPoint.FindResults = AxMappointControl1.ActiveMap.ObjectsFromPoint(e.x, e.y) ForEach result AsObjectIn searche IfTypeOf result Is MapPoint.geoshapetype Then .....never gets here EndIf Next EndSub |
| |||
| Re: Still stuck on the freeform event!
Hi, That is correct. You click on the Shape but not on the Location where the Shape is (probably the center). If you want a user to do something when clicking on a Shape use SelectionChange event. Eventually you can check if it is what you want and popup a menu at mouse position. As for your first question I did a similar test in the SelectionChange event handler, drawing a free form and then select it: Code: Console.WriteLine("selection change");
Shape s = map.Selection as Shape;
if (s != null)
Console.WriteLine(s.Type);
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Wilfried, thanks...! I got it working, based on your explination and code example I tried it again and it was good. I used the VB below. Thanks again. Michael Dim objmap As MapPoint.Map objmap = AxMappointControl1.ActiveMap Dim shape As MapPoint.Shape = objmap.Shapes.Item(1) If shape IsNothingThen MsgBox("no shape") Else MsgBox("type" & shape.Type) EndIf |
![]() |
| ||||
| Posted By | For | Type | Date | |
| MapPoint News - MP2K Magazine | This thread | Refback | 04-30-2007 04:55 PM | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 04-17-2007 01:59 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Start Draw shape (freeform) | Anonymous | MapPoint 2006/2009 Discussion | 2 | 10-24-2006 06:37 PM |
| ZoomIn() gets "stuck" and does not zoom | BobFromBoston | MapPoint 2006/2009 Discussion | 1 | 10-22-2006 12:54 PM |
| Getting the coordinates from a freeform shape | pst | MapPoint 2006/2009 Discussion | 5 | 07-14-2005 07:19 AM |
| freeform & 5-digit zips | msensel | MapPoint 2006/2009 Discussion | 1 | 12-12-2003 12:41 PM |
| View bounds of a Freeform Shape | Anonymous | MapPoint 2006/2009 Discussion | 0 | 04-29-2003 05:35 PM |
Cheap flights to Madrid
Visit Madrid with bullfighting and the "Golden Triangle of Art" ready for you to view. For cheap flights to Madrid book here.
European City Breaks
Find European City Breaks on Travel Counsellors. Based on holidays booked this year, these are the most popular City Breaks for 2006
Flights Canada
Our search results will show you a selection of airlines, travel agents and tour operators offering cheap flights to Canada. See for yourself who has the cheapest deals.
Bahamas Holidays
Bahamas Holidays offer pure blue skies, soft white beaches and the holiday of a lifetime. Visit us for a great deal to the Bahamas.
Cheap Balearics Holidays
Cheap Balearics holidays are available if you know when to book and who to book with. The Balearics have many fascinating places to visit all year round. The partying never stops.
Travel
Check out the travel options on Travel.co.uk.
Holidays in Cyprus
Visit the tombs of the island kings! Visit On The Beach for information on holidays in Cyprus.