Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

CommandBars.Find not working in 10.2.1.3497

$
0
0
Hello,

I have created a simple ArcMap AddIn, Framework .Net 3.5, with a single button in it.

The click method is this one:

Code:

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
    {
    }
}

The problem is,
Code:

comm
is always null, no matter wich button i search or if i use the guid instead, nothing is returned

Anyone with the same problem, and hopefully, a solution?

This code was working up to 10.1

Thanks

Fra

Viewing all articles
Browse latest Browse all 1374

Trending Articles