Form.RightToLeftLayout Form.RightToLeftLayout Form.RightToLeftLayout Form.RightToLeftLayout Property

定义

获取或设置一个值,该值指示是否打开从右向左的镜像放置。Gets or sets a value indicating whether right-to-left mirror placement is turned on.

public:
 virtual property bool RightToLeftLayout { bool get(); void set(bool value); };
public virtual bool RightToLeftLayout { get; set; }
member this.RightToLeftLayout : bool with get, set
Public Overridable Property RightToLeftLayout As Boolean

属性值

如果打开了从右到左的镜像放置,则为 true;否则对于标准子控件放置,为 falsetrue if right-to-left mirror placement is turned on; otherwise, false for standard child control placement. 默认值为 falseThe default is false.

注解

RightToLeftLayout属性是主要用于开发适用于全球用户的全球通用的窗体。The RightToLeftLayout property is primarily useful for developing world-ready forms for worldwide audiences. 许多窗体的设计,以便以从左到右的方式在窗体上布置控件。Many forms are designed so that controls are laid out on a form in a left-to-right fashion. 这些窗体都遵循这种书写方向的语言与兼容。These forms are compatible with languages that follow this writing direction. 但是,当向右到左的语言的用户显示的相同窗体,通常最好是反转窗体上控件的顺序。However, when you display the same forms to users of right-to-left languages, it is often preferable to reverse the order of the controls on the form. 如果这两个RightToLeftLayoutRightToLeft属性是true,镜像将打开的窗体,并且将从右到左控件位置和文本流。If both the RightToLeftLayout and RightToLeft properties are true, mirroring will be turned on for the form, and control placement and text flow will be right-to-left.

与不同RightToLeftRightToLeftLayout不会继承。Unlike RightToLeft, RightToLeftLayout does not inherit. 如果你想才会生效的子控件,必须将其设置的每个要镜像的子控件。If you want it to take effect for child controls, you must set it on each child control that you want mirrored.

不是所有者描述支持何时RightToLeftLayout设置为YesOwner draw is not supported when RightToLeftLayout is set to Yes. 所有者 draw 事件仍会发生,但未定义这些事件中编写任何代码的行为。The owner draw events will still occur, but the behavior of any code you author in these events is not defined. 此外, BackgroundImageOpacityTransparencyKey,和不支持的绘制事件。Additionally, BackgroundImage, Opacity, TransparencyKey, and the painting events are not supported.

RightToLeftLayoutRightToLeft属性会导致以下 Windows API 窗口样式设置:The RightToLeftLayout and RightToLeft properties cause the following Windows API window styles to be set:

  • RightToLeft设置为YesRightToLeftLayout设置为true,Windows 窗体设置WS_EX_LAYOUTRTL窗口样式,并删除WS_EX_RIGHTWS_EX_RTLREADING样式。When RightToLeft is set to Yes and RightToLeftLayout is set to true, Windows Forms sets the WS_EX_LAYOUTRTL window style, and removes the WS_EX_RIGHT and WS_EX_RTLREADING styles.

  • RightToLeft设置为YesRightToLeftLayout设置为No,Windows 窗体设置WS_EX_RIGHTWS_EX_RTLREADING窗口样式。When RightToLeft is set to Yes but RightToLeftLayout is set to No, Windows Forms sets the WS_EX_RIGHT and WS_EX_RTLREADING window styles.

更改此属性的值将引发RightToLeftLayoutChanged事件。Changing the value of this property raises the RightToLeftLayoutChanged event.

全球化问题的详细信息,请参阅开发全球通用应用程序的最佳实践For more information about globalization issues, see Best Practices for Developing World-Ready Applications.

适用于

另请参阅