$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
WinForms TreeView Control
Build complex navigation systems and display complex hierarchical structures
Home > WinForms UI Controls > User Manual > Localize TreeView Control in C#

Localize KetticTreeView in C#.NET

The Windows Forms KetticTreeView control provides the support of localization to display the text and message of this control in a specific language, so that you are able to deliver your application globally. Additionally, this control also provides the right to left languages support, which is capable of showing languages like Arabic, Persian, Urdu, and Hebrew. In the C# tutorial below, we shall demonstrate how to localize the KetticTreeView for Windows applications.

Guide on Localizing KetticTreeView control in C#.NET

  • Create a new project or open an existing one in your C# Windows Form application
  • Use the namespace, Kettic.WinForms.UI.Localization, which include the complete localizing C# classes
  • Create a descendant of the C# class KetticTreeViewLocalizationProvider in your .NET project
  • Override the GetLocalizedString() method, and then provide a translation for the messages
  • When translation message was not offered, this method will return the default value
  • Call to the base GetLocalizedString method in the default clause of the switch statement to guarantee the behavior
  • Implement a custom localization provider with the C# code below

public class MyEnglishTreeViewLocalizationProvider : TreeViewLocalizationProvider
{
public override string GetLocalizedString(string id)
{
switch (id)
{
case TreeViewStringId.ContextMenuNew:
return "New11";
}

return "";
}
}

  • After the implementation of the custom localization provider, we can apply it through instantiating and assigning it to the current localization provider. The following C# code shows how to achieve this.

TreeViewLocalizationProvider.CurrentProvider = new MyEnglishTreeViewLocalizationProvider();

Right-to-left Support by KetticTreeView in C#.NET

KetticTreeView control provides right to left support to display content from the right side to left side in specific languages like Arabic. This is achieved by enabling the RightToLeft property of the KetticTreeView control.

this.ketticLabel1.RightToLeft = RightToLeft.Yes;
this.ketticLabel1.Text = "KetticWizard Welcome page";
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