Does this line really work as expected?pCommand = New ControlsSelectFeaturesToolClass ' The selectfeatures toolFrom what I see, you need to invoke the correct UID for that SelectFeaturesTool. Not sure what dev environment you are working in, but here's how I start the SelecteFeatures Tool in the Button Click event in a .NET app:Private Sub btnRunByPolyGraphic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRunByPolyGraphic.Click
Dim pUID As New UID
pUID.Value = "esriArcMapUI.SelectFeaturesTool"
m_pApp.CurrentTool = m_pApp.Document.CommandBars.Find(pUID)
'do something
End Sub
Also, are you sure you want to set the .CurrentTool = pCommand IF pCommand is already .Enabled? Cause that is what you are doing in the code:If pCommand.Enabled = True Then
m_application.CurrentTool = pCommand
End If
Exit Sub
I mean, if it's already enabled then you don't need to set the current tool to it, right? I don't know, maybe I'm just a bit confused on what you are attempting there.