Change Caption of Base Command

Discussion created by deleted-user-ATjHIWsdQYmT on Apr 13, 2011
Latest reply on Nov 22, 2011 by cfox-esristaff
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
            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
                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
            End If

        Catch ex As Exception
        End Try
    End Sub