I want to label the features of feature layers in my TOC. This has to be using the CommandBar and CommandItem. How should I go about it? Some heads up will be appreciated
Thanks
If you already have a tool on a toolbar that displays the labels you would use the following code to find the command and just call ICommandItem.Execute to execute the command.
desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#2ffb7cab-820e-4581-970f-49c887108f87.htm
I don't recall any out-of-the-box commands that display labels. In my code I display the labels using IGeoFeatureLayer.DisplayAnnotation. This is mentioned starting on the following page.
Working with labels and annotation (ArcObjects)
Thank you for the quick response @Freddie. I was able to complete the action using the DisplayAnnotation method, but I wanted to follow the commandItem methods for this task.
I will try out the code in the link you mentioned. Thanks again!