Extending the Ribbon
You can add the controls to Ribbon either declaratively using an element file or programmatically add controls using custom code. Adding the custom Tab declaratively
1. In Visual Studio Choose Project –> Add new item then select Empty Element from the Add New Item Dialogue as shown below
2. Add the following code to the Element.xml file in the MyNewTab folder
The above code creates a new Tab element to the Ribbon, Set the value Ribbon.Tabs._children to Location when you want to add tab to existing group. Use Ribbon.ListItem.New.Controls._children to add a control to the new group in the tab.
4. Add the following code under Tab element
Scaling group contains two main elements MaxSize and Scale. Use MaxSize when there is no spacing constraints. Use Scale element when there is insufficient space for the template.
5. Add the below code in Controls element section as shown below
TemplateAlias attribute is used to hook up the control to the templates in the group element.
More about this concept can be read here
|Share this post :|