Select to view content in your preferred language

how to code for selection

2020
2
12-26-2010 08:52 AM
ChannaraRIN
Emerging Contributor
dear all ,
i want to write code for arcgis engine in vb.net for mouse down on map control to select layer.


thank you
0 Kudos
2 Replies
Venkata_RaoTammineni
Regular Contributor
dear all ,
i want to write code for arcgis engine in vb.net for mouse down on map control to select layer.


thank you


Hi,

You are looking for select layer or Select features ?
0 Kudos
AurimasRekstys
Emerging Contributor
I use this code to select element on map and then call my change value function:

Private Sub UIToolControl3_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
 
  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

  keiskr "gatves", "svarba", "1" 'this is my change value function, to change value for selected features
End Sub

Of course you would need to add UI Tool Control first.
0 Kudos