Windows应用程序中从右到左的控件!

时间:2022-01-12 15:55:22

i am a new windows application programmer and have a right-to-left language.
i want write my own app in rtl lang. how can i perform this?
should i set RightToLeft peroperty for any controls in forms to Yes or true?? this is very harmful!!
can I set something to convert and set controls to rtl? can i do some settings in "Settings.settings" file in properties folder?

我是一个新的Windows应用程序程序员,并有一个从右到左的语言。我想在rtl lang写我自己的应用程序。我怎么能这样做?我应该为表格中的任何控件设置RightToLeft peroperty为Yes或true?这是非常有害的!!我可以设置要转换的内容并将控件设置为rtl吗?我可以在属性文件夹中的“Settings.settings”文件中进行一些设置吗?

4 个解决方案

#1


The FlowLayoutPanel control arranges its contents in a horizontal or vertical flow direction. The FlowLayoutPanel control correctly reverses its flow direction in right-to-left (RTL) layouts. Any Windows Forms control, including other instances of FlowLayoutPanel, can be a child of the FlowLayoutPanel control. Given this, you should be able to control the flow direction of all of your controls with a single setting, provided they reside within a FlowLayoutPanel.

FlowLayoutPanel控件在水平或垂直流动方向上排列其内容。 FlowLayoutPanel控件在从右向左(RTL)布局中正确地反转其流向。任何Windows窗体控件(包括FlowLayoutPanel的其他实例)都可以是FlowLayoutPanel控件的子级。鉴于此,您应该能够使用单个设置控制所有控件的流向,前提是它们位于FlowLayoutPanel中。

#2


Just set

RightToLeft = true

for any control where this is important (anything containing text I imagine)

对于任何重要的控制(任何包含我想象的文本)

#3


See MSDN documentation for Control.RightToLeft and Ambient Properties

有关Control.RightToLeft和Ambient Properties的信息,请参阅MSDN文档

All you really have to do is set it on your form and its controls should take care of themselves. It's apparent on the simple case of a TextBox on a Form where the Form's RightToLeft property is set to Yes.

你真正需要做的就是在你的表格上设置它,它的控制应该照顾好自己。很明显,Form上的TextBox的简单情况是Form的RightToLeft属性设置为Yes。

#4


The simplest way ever is to add these two lines:

最简单的方法是添加以下两行:

this.RightToLeft = RightToLeft.Yes;
this.RightToLeftLayout = true;

Under this line (you will find it there already):

在这条线下(你会在那里找到它):

InitializeComponent();

#1


The FlowLayoutPanel control arranges its contents in a horizontal or vertical flow direction. The FlowLayoutPanel control correctly reverses its flow direction in right-to-left (RTL) layouts. Any Windows Forms control, including other instances of FlowLayoutPanel, can be a child of the FlowLayoutPanel control. Given this, you should be able to control the flow direction of all of your controls with a single setting, provided they reside within a FlowLayoutPanel.

FlowLayoutPanel控件在水平或垂直流动方向上排列其内容。 FlowLayoutPanel控件在从右向左(RTL)布局中正确地反转其流向。任何Windows窗体控件(包括FlowLayoutPanel的其他实例)都可以是FlowLayoutPanel控件的子级。鉴于此,您应该能够使用单个设置控制所有控件的流向,前提是它们位于FlowLayoutPanel中。

#2


Just set

RightToLeft = true

for any control where this is important (anything containing text I imagine)

对于任何重要的控制(任何包含我想象的文本)

#3


See MSDN documentation for Control.RightToLeft and Ambient Properties

有关Control.RightToLeft和Ambient Properties的信息,请参阅MSDN文档

All you really have to do is set it on your form and its controls should take care of themselves. It's apparent on the simple case of a TextBox on a Form where the Form's RightToLeft property is set to Yes.

你真正需要做的就是在你的表格上设置它,它的控制应该照顾好自己。很明显,Form上的TextBox的简单情况是Form的RightToLeft属性设置为Yes。

#4


The simplest way ever is to add these two lines:

最简单的方法是添加以下两行:

this.RightToLeft = RightToLeft.Yes;
this.RightToLeftLayout = true;

Under this line (you will find it there already):

在这条线下(你会在那里找到它):

InitializeComponent();