如何初始化addin?

怎么初始化addin 比如初始化时将其中某个button设为不可用 环境是arcmap10.1
已邀请:

朱新颖

赞同来自: 石羽 arcgis

该自定义button有OnUpdate()方法,在该方法下设置,将其Enabled属性设为false,比如:
 protected override void OnUpdate()
        {            
            //IMap map = ArcMap.Document.FocusMap;
            //// Bail if map has no layers.
            //if (map.LayerCount > 0)
            //{
             this.Enabled = true;
            //}
            //else
            //    this.Enabled = false;
            //ArcMap.Application != null;
        }

BEIYIGIS - 90后

赞同来自: arcgis

已解决,之前忘了回复。另外需要设置button的ondemand为false

要回复问题请先登录注册