protected override void OnClick() { try { UID commandID = new UIDClass(); commandID.Value = "esriArcMapUI.ZoomToSelectedCommand"; ICommandItem comm = ArcMap.Application.Document.CommandBars.Find(commandID.Value); if(comm != null) comm.Execute(); } catch { } }commis always null, no matter wich button i search or if i use the guid instead, nothing is returned
Solved! Go to Solution.
protected override void OnClick()
{
try
{
UID commandID = new UIDClass();
commandID.Value = "esriArcMapUI.MxSelectionMenu";
ICommandItem comm = ArcMap.Application.Document.CommandBars.Find(commandID.Value);
if(comm != null)
comm.Execute();
}
catch
{
}
}ICommandItem comm = ArcMap.Application.Document.CommandBars.Find(commandID);