axmap ShapeIdentified event problem

Mar 10, 2016 at 12:06 PM
Hallo,
I have a problem with shapeidentified (and also ShapeHighlighted) event: it works fine with point shapefiles, but if I add a polygon shapefile to the map, only this one can be identified.
thanks

This is the code I am using:

Private Sub AxMap1_ShapeIdentified(sender As Object, e As _DMapEvents_ShapeIdentifiedEvent) Handles AxMap1.ShapeIdentified
    If e.layerHandle = m_layDighe_hndl OrElse e.layerHandle = m_laySismi_hndl OrElse e.layerHandle = m_layComuni_hndl Then
        Dim sf As Shapefile = AxMap1.get_Shapefile(e.layerHandle)

        Dim tooltipLbl As String = ""

        If sf IsNot Nothing Then

            If e.layerHandle = m_layDighe_hndl Then
                tooltipLbl = "Diga di: " + sf.CellValue(sf.Table.FieldIndexByName("nome"), e.shapeIndex).ToString() + " " + _
                    "Anno: " + sf.CellValue(sf.Table.FieldIndexByName("annocoll"), e.shapeIndex).ToString()
            ElseIf e.layerHandle = m_laySismi_hndl Then
                tooltipLbl = "Magnitudo: " + sf.CellValue(sf.Table.FieldIndexByName("magnitudo"), e.shapeIndex).ToString() + " " + _
                    "Anno: " + sf.CellValue(sf.Table.FieldIndexByName("anno"), e.shapeIndex).ToString()
            ElseIf e.layerHandle = m_layComuni_hndl Then
                tooltipLbl = "Comune: " + sf.CellValue(sf.Table.FieldIndexByName("nome"), e.shapeIndex).ToString()
            End If

            AxMap1.ShowToolTip(tooltipLbl, 5000)

        End If
    End If
End sub