Question 1:How to Disable the add-in button when the ArcMap started,then I use the SelectByRectangletool select features,then the button enabled! I am a fresh man about the add-in.
Question 2:I made a menu as show ,As the figure shows, how to avoid the part of in red rectangle,because the menu do not have the child menu again,but it is show the arrow ,and part of the child menu.
I means the tool’s skin is gray,and it is not activate
I am sorry about my poor engilsh
here is the question2's config.esriaddinx file:
<ArcMap>
<Commands>
<Button id="Yangtze_University_GRP_Mult" class="Mult" message="new" caption="test" tip="tip" category="Add-In Controls" image="Images\1.png" />
<MultiItem id="ESRI_SelectionSample_MultiItem" caption="MultiItem AddIn" class="ZoomToLayerMultiItem" >
</MultiItem>
</Commands>
<Menus>
<!--main menu-->
<Menu id="Yangtze_University_GRP_My_Menu" caption="MainMenu" isRootMenu="true">
<Items>
<Menu refID="Yangtze_University_GRP_My_Menu_2" />
<Menu refID="Yangtze_University_GRP_My_Menu_1" />
</Items>
</Menu>
<!--submenu-->
<Menu id="Yangtze_University_GRP_My_Menu_2" caption="New file" isRootMenu="false">
<Items>
<!--<Button refID="Yangtze_University_GRP_Mult" />-->
<Menu refID="Yangtze_University_GRP_My_Menu_3" />
<Menu refID="Yangtze_University_GRP_My_Menu_4" />
<Menu refID="Yangtze_University_GRP_My_Menu_5" />
<MultiItem refID="ESRI_SelectionSample_MultiItem" />
</Items>
</Menu>
<!--third menu-->
<Menu id="Yangtze_University_GRP_My_Menu_3" caption="test1" isRootMenu="false" isShortcutMenu="true" />
<Menu id="Yangtze_University_GRP_My_Menu_4" caption="test2" isRootMenu="false" isShortcutMenu="true" />
<Menu id="Yangtze_University_GRP_My_Menu_5" caption="test3" isRootMenu="false" isShortcutMenu="true" />
</Menus>
<Toolbars>
<Toolbar id="Yangtze_University_GRP_My_Toolbar" caption="toolbar" showInitially="true">
<Items>
<Menu refID="Yangtze_University_GRP_My_Menu" />
</Items>
</Toolbar>
</Toolbars>
</ArcMap>
Best Answer
To have a button enabled pending a condition, you first have to change one of the parameters in the Config.esriaddinx file. This is in the help under Delay loading section. You have to include 'onDemand="false"' in the button declaration, like this
Then in the code for your button, you'll have to add in the OnUpdate sub, which will enable or diable the button depending on the condition. It sounds like you'll want to check whether there are selected features in your feature class.
For your second question, can you post your Config.esriaddinx file?
*Edit
Here is the Config.esriaddinx I use to create this toolbar for an extension.