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

Still stuck on the freeform event!

This is a discussion on Still stuck on the freeform event! within the MapPoint Desktop 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 ...

  1. #1
    mmartin is offline Member Yellow Belt
    Join Date
    Apr 2007
    Posts
    30

    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

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

    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 ?

  3. #3
    mmartin is offline Member Yellow Belt
    Join Date
    Apr 2007
    Posts
    30

    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

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

    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.

  5. #5
    mmartin is offline Member Yellow Belt
    Join Date
    Apr 2007
    Posts
    30

    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Start Draw shape (freeform)
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-24-2006, 07:37 PM
  2. ZoomIn() gets "stuck" and does not zoom
    By BobFromBoston in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-22-2006, 01:54 PM
  3. Getting the coordinates from a freeform shape
    By pst in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 07-14-2005, 08:19 AM
  4. freeform & 5-digit zips
    By msensel in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-12-2003, 01:41 PM
  5. View bounds of a Freeform Shape
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-29-2003, 06:35 PM

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