MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Still stuck on the freeform event!

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-16-2007
Junior Member
Yellow Belt
 
Join Date: Apr 2007
Posts: 29
Question Still stuck on the freeform event!

Hello people,

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2007
Junior Member
Yellow Belt
 
Join Date: Apr 2007
Posts: 29
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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);
And it displays: "GeoFreeForm" so this looks ok to me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2007
Junior Member
Yellow Belt
 
Join Date: Apr 2007
Posts: 29
Smile Re: Still stuck on the freeform event!

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/still-stuck-freeform-event-5836.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 02:27 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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.


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