-
Notifications
You must be signed in to change notification settings - Fork 1
Wrapper class RibbonItems
The custom build tool RibbonTools64 generates source files named RibbonItems.Designer.cs for the programming language C# or RibbonItems.Designer.vb for Visual Basic as default class name. In this file you get a wrapper class for all Ribbon items (Controls, ...) one defined in the RibbonMarkup.xml file. The wrapper class does the instantiation for all Ribbon items and gives you the defined Ids. You should not modify this file. The wrapper class is defined as a partial class. So, you can extend this class by a file named RibbonItems.cs with the same namespace and class name. The namespace of the wrapper class is always “WinForms.Ribbon” and the class name is RibbonItems. Don’t forget the partial keyword at the class declaration. The constructor of the wrapper class RibbonItems have to be called in the Form constructor after InitializeComponent(). The parameter of the constructor is the RibbonStrip Control which is placed to the Form. In the file RibbonItems.cs you can define the whole logic including events for the Ribbon items. In your user defined RibbonItems.cs (RibbonItems.vb) you can also define additional constructors with some more parameters if you need them in your logic. These constructors have to call the standard constructor in RibbonItems.Designer.cs with the RibbonStrip Control as parameter.
Example MainForm
...
using WinForms.Ribbon;
namespace your_namespace
{ public partial class MainForm : Form
{
private RibbonItems _ribbonItems;
public MainForm()
{
InitializeComponent();
ribbon.RibbonEventException += Ribbon_RibbonEventException;
_ribbonItems = new RibbonItems(ribbon);
_ribbonItems.Init(this);
}
}
}
File: RibbonItems.cs
namespace WinForms.Ribbon
{
partial class RibbonItems
{
/// <summary>
/// Must be called from MainForm Constructor
/// </summary>
/// <param name="form">The MainForm</param>
public void Init(MainForm form)
{
...
}[!Hint] If you have more than one RibbonStrip controls for different Forms in the project, then you should use RibbonTools64 settings option "Wrapper class name like Markup file instead RibbonItems".
With this optional setting switch "Wrapper class name like Markup file instead RibbonItems" one can generate a wrapper file and class name like the markup file. The namespace for these classes are always WinForms.Ribbon. This will help for multiple RibbonStrip controls in an application.
-
Basics
- Introduction, Background on the windows ribbon framework
- Basic Ribbon Wrapper ; Basic .NET wrappers for windows ribbon framework.
- Quickstart Tutorial
- First WinForms Ribbon Application ; How to create an empty WinForms application with ribbon support.
-
RibbonFramework Controls
- RibbonStrip ; Main class, derived from System.Windows.Forms.Control
- RibbonApplicationMenu
- RibbonButton
- RibbonCheckBox
- RibbonComboBox
- RibbonDropDownButton
- RibbonDropDownColorPicker
- RibbonDropDownGallery
- RibbonFontControl
- RibbonGroup
- RibbonHelpButton
- RibbonInRibbonGallery
- RibbonMenuGroup
- RibbonQuickAccessToolbar
- RibbonRecentItems
- RibbonSpinner
- RibbonSplitButton
- RibbonSplitButtonGallery
- RibbonTab
- RibbonTabGroup
- RibbonToggleButton
-
RibbonFramework EventArgs classes
-
RibbonFramework PropertySet classes
-
RibbonFramework classes, interfaces, enums
-
RibbonFramework features
-
RibbonFramework Samples
- ApplicationMenu with Buttons ; How to use the ribbon application menu.
- ApplicationMenu with SplitButton and DropDownButton ; How to use the ribbon application menu with ribbon split button and ribbon dropdown button controls.
- Tabs, Groups and HelpButton ; How to use ribbon tabs, groups and the ribbon help button control.
- Spinner ; How to use the ribbon spinner control.
- ComboBox ; How to use the ribbon combo box control.
- Changing Ribbon Colors ; How to change the ribbon colors.
- Working with Images ; How to work with images in the ribbon.
- DropDownGallery, SplitButtonGallery and InRibbonGallery ; How to use the ribbon drop down gallery, split button gallery and in ribbon gallery controls.
- CheckBox and ToggleButton ; How to use the ribbon check box and toggle button controls.
- DropDownColorPicker ; How to use the ribbon drop down color picker control.
- FontControl ; How to use the ribbon font control.
- ApplicationModes ; How to work with ribbon application modes.
- ContextualTabs ; How to work with ribbon contextual tabs.
- ContextPopup ; How to work with ribbon context popup.
- RecentItems ; How to work with ribbon recent items control.
- QuickAccessToolbar ; How to work with the ribbon quick access toolbar.
- SizeDefinition ; How to define custom size definitions for ribbon group elements.
- Localization ; How to localize a ribbon.
-
RibbonTools
- RibbonTools64 ; Development support for creating markup files for the Ribbon framework.
- Create a new project ; Create a WordPad sample project
- Specifying Ribbon Commands
- Designing Ribbon Views
- Preview the Ribbon
- Wrapper class RibbonItems ; An auto generated wrapper class from the ribbon markup.
- Convert Image to ARGB Bitmap
-
How to ...