Get the records values

1962
2
11-30-2011 03:55 AM
JuliShaki
New Contributor
I am really sorry for my terrible English.But I need your help.I would really appreciate someone giving me some help with this small for you and big for me problem.
Here is a procedure I clicking on the object I'm doing it Select, and how to get to the record now that is allocated, saw somewhere Sample and I do not remember where = (

Private Sub Info_dil_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
  Dim pMxApp As IMxApplication
  Dim pMxDoc As IMxDocument
  Dim pMap As IMap
  Dim pActiveView As IActiveView
  Dim pEnvelope As IEnvelope
  Dim pIDArray As IArray
  Dim pIdentify As IIdentify
  Dim pIdObj As IIdentifyObj
  Dim pFeatIdObj As IFeatureIdentifyObj
  Set pMxApp = Application
  Set pMxDoc = Application.Document
  Set pMap = pMxDoc.FocusMap
  Set pActiveView = pMap


  Set pEnvelope = pMxDoc.CurrentLocation.Envelope
  pEnvelope.Expand pMxDoc.SearchTolerance, pMxDoc.SearchTolerance, False

  'Refresh the old selection to erase it
  pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
  'Perform the selection using a point created on mouse down
  pMap.SelectByShape pEnvelope, pMxApp.SelectionEnvironment, True
  'Refresh again to draw the new selection
  pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing

End Sub
0 Kudos
2 Replies
GeorgeFaraj
Occasional Contributor III
In C#, (if you want to walk the selected elements):

IGraphicsContainerSelect graphicsContainerSelect = 
    mapControl.ActiveView.FocusMap as IGraphicsContainerSelect;
if ( graphicsContainerSelect.ElementSelectionCount != 0 )  {
    IEnumElement enumElement = graphicsContainerSelect.SelectedElements;
    selectedElement = enumElement.Next();
    // if you only want one of the selections you can stop here.
    // if you need more: 
    while (selectedElement != null) {  
        // do something with the current selectedElement, and then:
        selectedElement = enumElement.Next();
    }
}
0 Kudos
JuliShaki
New Contributor
😞 I don't know C#, but I think I understand what you mean, thanks
0 Kudos