POST
|
Okay, so I only have to use AddTableIdentifyOID instead of AddLayerIdentifyOID and pass a ITable instead of a ILayer ? Do I still need ClearLayers ? I'm sorry but I am somehow lost. Could you give me a hint what I exactly need to change in my code?
... View more
06-22-2020
02:34 AM
|
0
|
1
|
57
|
POST
|
I want to use the ArcMap Identify-Tool inside a WindowsForm. So I've created a button and added a clickevent: Private Sub btnIdentify_Click(sender As Object, e As EventArgs) Handles btnIdentify.Click Dim intObjectID As Integer = lstResults.SelectedValue Dim pLayer As ILayer2 = pDocument.FocusMap.Layer(0) DoIdentify(pLayer, intObjectID) End Sub I've also created a sub procdedure similar to the one in the ArcObjects API Reference for .NET Private Sub DoIdentify(ByVal pLayer As ILayer, ByVal intObjectID As Integer) If pActiveView Is Nothing Or pLayer Is Nothing Or intObjectID <= 0 Then Return End If Dim pMap As IMap = pActiveView.FocusMap Dim pIdentifyDialog As IIdentifyDialog = New IdentifyDialogClass() pIdentifyDialog.Map = pMap pIdentifyDialog.ClearLayers() Dim pScreenDisplay As IScreenDisplay = pActiveView.ScreenDisplay Dim pDisplay As IDisplay = pScreenDisplay pIdentifyDialog.Display = pDisplay pIdentifyDialog.AddLayerIdentifyOID(pLayer, intObjectID) pIdentifyDialog.Show() End Sub This code works perfectly fine. But I really want to use the new IIdentifyDialog2 Interface. But if I change the code to Private Sub DoIdentify(ByVal pLayer As ILayer, ByVal intObjectID As Integer) If pActiveView Is Nothing Or pLayer Is Nothing Or intObjectID <= 0 Then Return End If Dim pMap As IBasicMap2 = pActiveView.FocusMap Dim pIdentifyDialog As IIdentifyDialog2 = New IdentifyDialogClass() pIdentifyDialog.BasicMap = pMap pIdentifyDialog.ClearLayers() Dim pScreenDisplay As IScreenDisplay3 = pActiveView.ScreenDisplay Dim pDisplay As IDisplay = pScreenDisplay pIdentifyDialog.Display = pDisplay pIdentifyDialog.AddLayerIdentifyOID(pLayer, intObjectID) pIdentifyDialog.Show() End Sub I get a NullReferenceException at pIdentifyDialog.ClearLayers() I already tried so many things but somehow I can't get it to work with the new Identify-Tool. Does anyone know the answer?
... View more
06-21-2020
07:18 AM
|
0
|
3
|
168
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|