如何本地化 UserControl [英] How to localize UserControl

查看:40
本文介绍了如何本地化 UserControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个必须支持多种语言的 Windows 应用程序.

I'm developing a windows application that must support multiple language.

我已经关注了下面的文章 http://msdn.microsoft.com/en-us/library/y99d1cd3(v=vs.71).aspx 使我的 Windows 应用程序可本地化.

I've followed the article below http://msdn.microsoft.com/en-us/library/y99d1cd3(v=vs.71).aspx to make my windows application localizable.

除了用户控件之外,一切正常.我是否必须为每种语言创建一个用户控件?如何让用户控件继承从右到左的属性?这样做的最佳做法是什么?

Everything works fine except the usercontrols. Do i have to create a usercontrol for each language? How to make the usercontrol inherit the Right to left property? What is the best practice to do it?

推荐答案

UserControls 必须以与表单相同的方式本地化 (Localizable = True, Language = ...),当它们被嵌入到本地化的表单中时,你不会在设计器中看到本地化,但在运行时本地化做得很好.

UserControls have to be localized in the same way as forms (Localizable = True, Language = ...), you don't see the localization in the designer when they are embedded into a localized Form but during the runtime the localization is done well.

对于 RightToLeft 属性:选择您的 UserControl(选择其中的一个控件并按 ESC 直到主控件被选中 - 在属性面板中您应该看到您的 UserControl 的名称和类型 =System.Windows.Forms.UserControl),转到属性面板并搜索 RightToLeft 属性,在同一面板中您还有 Localizable> 和 Language 属性,必须像在表单中一样使用.

For the RightToLeft property: select your UserControl (select a control inside it and press ESC until the main control is selected - in the property panel you should see the name of your UserControl and the type = System.Windows.Forms.UserControl), go to the property panel and search for the RightToLeft property, in the same panel you have also the Localizable and Language property that has to be used as you do in Forms.

这篇关于如何本地化 UserControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆