Delete selected elements based on AE --
'// Deletes all features selected on the current layer
Public Sub DeleteAllSelectedFeatures (ByVal pFeatureCursor As IFeatureCursor, ByVal GeometryTypeStr As String)
Dim pWorkspaceEdit As IWorkspaceEdit
Dim pFeature As IFeature
'If there are no features currently selected then nothing to do
If pFeatureCursor Is Nothing Then Exit Sub
Try
Dim bResponse As DialogResult
BResponse = MsgBox ("are you sure to delete all" & GeometryTypeStr & "elements? ", MessageBoxButtons. YesNo)
If bResponse = Windows. Forms. DialogResult. Yes Then
'Loop over the selected features deleting each in turn
PWorkspaceEdit = pSdeWorkspace
PWorkspaceEdit. StartEditing (True)
PWorkspaceEdit. StartEditOperation ()
PFeature = pFeatureCursor. NextFeature
While Not pFeature Is Nothing
PFeature. Delete ()
PFeature = pFeatureCursor. NextFeature
End While
PWorkspaceEdit. StopEditOperation ()
PWorkspaceEdit. StopEditing (True)
End If
MainForm1.AxMapControl1. ActiveView. Refresh ()
Exit Sub
Catch ex As Exception
MsgBox (ex. ToString)
End Try
End Sub