I have a tool that inherits BaseCommand. It's set as a Toggle button to be toggled on when editing and off when not. When toggled on the caption should read "Stop Editing" and when Off it should read "Start Editing". The code below worked fine in 9.3.1 but for some reason the caption no longer changes. Any ideas? Public Overrides Sub OnClick()
'TODO: Add StartStopEditing.OnClick implementation
Dim pID As New UID
Dim pfLayer As IFeatureLayer = Nothing
Dim pDataSet As IDataset = Nothing
Dim pMxDoc As IMxDocument = Nothing
'Start/Stop Editing Sign workspace
Try
pID.Value = "esriEditor.Editor"
_pEditor = m_application.FindExtensionByCLSID(pID)
pMxDoc = CType(m_application.Document, IMxDocument)
pfLayer = pMxDoc.FocusMap.Layer(GetIndexNumberOfLayerName(pMxDoc.ActiveView, sLayerName))
pDataSet = pfLayer.FeatureClass
If _pEditor.EditState = ESRI.ArcGIS.Editor.esriEditState.esriStateNotEditing Then
_pEditor.StartEditing(pDataSet.Workspace)
MyBase.m_caption = "Stop Editing"
MyBase.m_checked = True
ElseIf _pEditor.EditState = ESRI.ArcGIS.Editor.esriEditState.esriStateEditing Then
MyBase.m_caption = "Start Editing"
MyBase.m_checked = False
_pEditor.StopEditing(True)
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub