Export (0) Print
Expand All
Expand Minimize

Control.RightToLeft Property

Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

abstract RightToLeft : RightToLeft with get, set 
override RightToLeft : RightToLeft with get, set

Property Value

Type: System.Windows.Forms.RightToLeft
One of the RightToLeft values. The default is Inherit.

ExceptionCondition
InvalidEnumArgumentException

The assigned value is not one of the RightToLeft values.

The RightToLeft property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a Button will have the same BackColor as its parent Form by default. For more information about ambient properties, see the AmbientProperties class or the Control class overview.

The RightToLeft property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. When this property is set to RightToLeft.Yes, control elements that include text are displayed from right to left.

NoteNote

If the value of the RightToLeft property is changed at run time, only raw text without formatting is preserved.

The following are a few examples of how control elements are affected by the RightToLeft property value of RightToLeft.Yes :

  • Vertical scroll bars are displayed on the left side rather than right side of scrollable controls (for example, Form, Panel, multiline TextBox, and RichTextBox).

  • Horizontal scroll bars start with the scroll box (thumb) right-aligned.

  • The check box element alignment, controlled by the CheckAlign property, is reversed for CheckBox and RadioButton controls.

  • Items in list box, combo box, and up-down controls are right aligned.

  • Up and down buttons are left-aligned on NumericUpDown and DomainUpDown controls.

  • Menus (MainMenu, MenuItem, and ContextMenu) are displayed right-aligned.

  • The alignment of toolbar buttons on a ToolBar control or the alignment of text on a ToolBarButton is not affected by the RightToLeft property.

  • AxHost supports right-to-left alignment; however, the effect on an ActiveX control depends on the extent to which the control author implemented support for right-to-left display.

Notes to Inheritors

When overriding the RightToLeft property in a derived class, use the base class's RightToLeft property to extend the base implementation. Otherwise, you must provide all the implementation. You are not required to override both the get and set accessors of the RightToLeft property; you can override only one if needed.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft