Using the ResourceProvider to Customize the Ribbon MiniToolbar
This article explains how to add a custom RibbonButton to the Ribbon MiniToolbar using the ResourceProvider class.

The new TXText
This way, you can use all TX Text Control resources in other user interface elements (such as the mini toolbar) to provide a consistent user experience.
The following code is used to create a new ribbon group with a button in the mini toolbar which is part of TX Text Control. A print button is inserted that prints the current document.
// default value
float m_DPI = 96;
public Form1()
{
InitializeComponent();
// use the system DPI
m_DPI = CreateGraphics().DpiX;
}
private void textControl1_TextMiniToolbarInitialized(object sender,
TXTextControl.MiniToolbarInitializedEventArgs e)
{
// add separators to all groups
foreach (RibbonGroup group in e.MiniToolbar.RibbonGroups)
{
group.ShowSeperator = true;
}
// create a new group
RibbonGroup rgPrint = new RibbonGroup()
{
ShowSeperator = false
};
// add new group to mini toolbar
e.MiniToolbar.RibbonGroups.Add(rgPrint);
// create new RibbonButton
RibbonButton rbPrint = new RibbonButton()
{
// get the resources from the ResourceProvider
SmallIcon = ResourceProvider.GetSmallIcon("TXITEM_Print", m_DPI),
LargeIcon = ResourceProvider.GetLargeIcon("TXITEM_Print", m_DPI),
Text = ResourceProvider.GetText("TXITEM_Print"),
KeyTip = ResourceProvider.GetKeyTip("TXITEM_Print")
};
// set the tool tip
rbPrint.ToolTip.Description = ResourceProvider.GetToolTipDescription("TXITEM_Print");
rbPrint.ToolTip.Title = ResourceProvider.GetToolTipTitle("TXITEM_Print");
// attached a click event
rbPrint.Click += RbPrint_Click;
// add a RibbonButton to the new group
rgPrint.RibbonItems.Add(rbPrint);
}
private void RbPrint_Click(object sender, EventArgs e)
{
textControl1.Print("MyDocument");
}
The TXText
This way, the ResourceProvider always returns a pixel-perfect image based on the current resolution.
Also See
This post references the following in the documentation:
- TXText
Control. Windows. Forms. Resource Provider Class - TXText
Control. Windows. Forms. Resource Provider. Get Small Icon Method
Windows Forms
Text Control combines the power of a reporting tool and an easy-to-use WYSIWYG word processor - fully programmable and embeddable in your Windows Forms application. TX Text Control .NET for Windows Forms is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component for Visual Studio.