Products Technologies Demo Docs Blog Support Company

X17: Using the Windows Forms Resource Provider

The new ResourceProvider class gives access to the all high resolution images used in the built-in ribbon tabs and toolbars.

X17: Using the Windows Forms Resource Provider

The new TXTextControl.Windows.Forms.ResourceProvider class gives access to the all high resolution images used in the built-in ribbon tabs and toolbars. The ResourceProvider is also returning other built-in resources such as item texts and tooltips.

This way, you can use all TX Text Control resources in other user interfaces to provide a consistent user experience. The ResourceProvider allows developers to request a specific resource with a custom resolution, a culture and colors for icons that provide color settings such as "Text Color" or "Text Highlight Color".

The following code creates a small bitmap with a 16px raster for the resolution of 96 DPI:

ImageSourceSettings m_ImageSourceSettings = new ImageSourceSettings();
Bitmap bmp = GetSmallIcon("TXITEM_Print", 96, m_ImageSourceSettings);

The first parameter is the identifier of the item that is associated with the requested small icon. All items have a unique identifier listed in the documentation. The second parameter specifies the resolution that is used to create the requested icon. And the third parameter can be used to specify a TXTextControl.Windows.Forms.ResourceProvider.ImageSourceSettings class with additional settings for receiving the small image such as the culture or colors for color related resources.

To help you finding the proper item name (identifier), we published a Resource Manager tool that lists all available types and their items. The following screenshot shows this tool:

Resource Manager

In the drop-down list Selected Ribbon Tab, you can choose the various ribbon tabs and other available collections. After selecting a type, all available icons are listed in the panel:

Resource Manager

Now, you can use the mouse to hover over the icons in the panel. The name of the selected item is displayed in a text box, can be selected and copied to the clipboard for your usage:

Resource Manager

The project can be downloaded from our GitHub account. If you are interested, it also shows how to iterate through the different collections and how to retrieve the resources.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Also See

This post references the following in the documentation:

  • TXTextControl.Windows.Forms.ResourceProvider Class
  • TXTextControl.Windows.Forms.ResourceProvider.ImageSourceSettings Class

GitHub

Download and Fork This Sample on GitHub

We proudly host our sample code on github.com/TextControl.

Please fork and contribute.

Download ZIP

Open on GitHub

Open in Visual Studio

Requirements for this sample

  • Visual Studio 2017 or better
  • TX Text Control .NET for Windows Forms X17 (trial sufficient)

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.

See Windows Forms products

Related Posts

ASP.NETWindows FormsWPF

TX Text Control 33.0 SP3 is Now Available: What's New in the Latest Version

TX Text Control 33.0 Service Pack 3 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ASP.NETWindows FormsWPF

TX Text Control 33.0 SP2 is Now Available: What's New in the Latest Version

TX Text Control 33.0 Service Pack 2 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ActiveXASP.NETWindows Forms

Service Pack Releases: What's New in TX Text Control 33.0 SP1 and 32.0 SP5

TX Text Control 33.0 Service Pack 1 and TX Text Control 32.0 Service Pack 5 have been released, providing important updates and bug fixes across platforms. These service packs improve the…


ASP.NETWindows FormsWPF

The Wait is Over: TX Text Control for Linux is Officially Here

We are very excited to announce the release of TX Text Control 33.0 which includes the long awaited Linux version of TX Text Control. This version allows you to integrate TX Text Control into your…


ASP.NETWindows FormsWPF

Full .NET 9 Support in Text Control .NET Components for ASP.NET Core,…

.NET 9 will be launched tomorrow, November 12, at the .NET Conf 2024 with updates to cloud capabilities, security, and performance. TX Text Control .NET components are fully compatible with .NET 9…