$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
CommandBar Control for C# Windows Forms
Customize localization for CommandBar in Windows Forms C# projects
Home > WinForms UI Controls > User Manual > Localization in C#

Localize CommandBar in WinForms C# Tutorial

The WinForms CommandBar control is a powerful and easy to use user interface control for Windows Forms. This CommandBar control provides large flexibility for developers to customize it. This article will talk about the localization customizing to the command bar.
Developers can localize command bar to display control and messages in a specific language through the coming steps.
  • Classes that are needed for localization customizing have been defined in WinFormsControls.UI namespace.
  • Create a class that inherits from the CommandBarLocalizationProvider class.
  • Override the method of GetLocalizedString.
  • Offer a translation to the label and user information. Otherwise, the default setting will be returned when the translation is not provided. In the example, the process will be guaranteed by the call to the GetLocalizedString method in the default clause of the switch statement.
The following C# code snippet shows how to implement the localization to command bar control

public class MyFrenchCommandBarLocalizationProvider : CommandBarLocalizationProvider
{
public override string GetLocalizedString(string id)
{
switch (id)
{
case CommandBarStringId.CustomizeDialogChooseToolstripLabelText: return "Rearrange a toolstrip:";
case CommandBarStringId.CustomizeDialogItemsPageTitle: return "Items";
case CommandBarStringId.CustomizeDialogMoveUpButtonText: return "Move Up";
case CommandBarStringId.CustomizeDialogToolstripsPageTitle: return "toolstrips";
case CommandBarStringId.OverflowMenuCustomizeText: return "Customize...";
default: return base.GetLocalizedString(id);
}
}
}
The C# code below illustrates the process of applying, instantiating, and assigning the localization customizing provider to the current localization provider

CommandBarLocalizationProvider.CurrentProvider = new MyFrenchCommandBarLocalizationProvider();
The C# code snippet posed previous also demonstrates the process to localize the command bar control.

Right to Left Support by CommandBar Control

The WinForms CommandBar Control provides the support of right to left so that to meet the requirements on right to left reading and writing languages like Arabic. Developers can easily display the content of commandbar instance in a right to left direction via change the value of the property RightToLeft to Yes

this.commandBar1.RightToLeft = RightToLeft.Yes;
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls