Form.RightToLeftLayout Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
true if right-to-left mirror placement is turned on; otherwise, false for standard child control placement. The default is false.
Remarks
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. 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.
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.
Owner draw is not supported when RightToLeftLayout is set to Yes. The owner draw events will still occur, but the behavior of any code you author in these events is not defined. Additionally, BackgroundImage, Opacity, TransparencyKey, and the painting events are not supported.
The RightToLeftLayout and RightToLeft properties cause the following Windows API window styles to be set:
When RightToLeft is set to
Yesand RightToLeftLayout is set totrue, Windows Forms sets theWS_EX_LAYOUTRTLwindow style, and removes theWS_EX_RIGHTandWS_EX_RTLREADINGstyles.When RightToLeft is set to
Yesbut RightToLeftLayout is set toNo, Windows Forms sets theWS_EX_RIGHTandWS_EX_RTLREADINGwindow styles.
Changing the value of this property raises the RightToLeftLayoutChanged event.
For more information about globalization issues, see Best Practices for Developing World-Ready Applications.