Click here to Skip to main content
Click here to Skip to main content

Windows Forms and Controls with Right to Left Layout

, 14 Nov 2003
Rate this:
Please Sign up or sign in to vote.
You can get right to left Forms and Controls with mirroring property, which Right to Left Common property can't do.

RightToLeft Property

The base Control class (from which Forms derive) includes a RightToLeft property that you can set to change the reading order of a Form and its controls. If you set the Form's RightToLeft property, by default, controls on the Form inherit this setting. However, you can also set the RightToLeft property individually on most controls.

The effect of the RightToLeft property can differ from one control to another. In some controls it only sets the reading order, as in the Button, TreeView and ToolTip controls. In other controls, the RightToLeft property changes both reading order and layout. This includes the RadioButton, ComboBox and CheckBox controls. The following table provides details on how the RightToLeft property affects individual Windows Forms controls.

Control/Component Effect of RightToLeft property Requires mirroring?
Button Sets the RTL reading order No
CheckBox The check box is displayed on the right side of the text No
CheckedListBox All the check boxes are displayed on the right side of the text No
ColorDialog Not affected; depends on the language of the operating system No
ComboBox Items in combo box control are right-aligned No
ContextMenu Appears right-aligned with RTL reading order No
DataGrid Appears right-aligned with RTL reading order No
DateTimePicker Not affected; depends on the language of the operating system No
DomainUpDown Left-aligns the up and down buttons No
ErrorProvider Not supported No
FontDialog Depends on the language of the operating system No
GroupBox The caption is displayed right aligned. Child controls may inherit this property. No
HScrollBar Starts with the scroll box (thumb) right-aligned No
ImageList Not required No
Label Displayed right-aligned No
LinkLabel Displayed right-aligned No
ListBox Items are right-aligned No
ListView Sets the reading order to RTL; elements stay left-aligned Yes
MainMenu Displayed right-aligned with RTL reading order at run time (not at design time) No
MonthCalendar Not affected; depends on the language of the operating system No
NotifyIcon Not supported No
NumericUpDown Up and down buttons are left-aligned No
OpenFileDialog Not affected; depends on the language of the operating system No
PageSetupDialog Not affected; depends on the language of the operating system No
Panel Child controls may inherit this property Yes
PictureBox Not supported No
PrintDialog Not affected; depends on the language of the operating system No
PrintDocument The vertical scroll bar become left-aligned and the horizontal scroll bar starts from the left No
PrintPreview Not affected by this property No
PrintPreviewDialog Text displayed in a Form's title bar is right-aligned No
ProgressBar Not affected by this property Yes
RadioButton The radio button is displayed on the right side of the text No
RichTextBox Control elements that include text are displayed from right to left with RTL reading order No
SaveFileDialog Not affected; depends on the language of the operating system No
Splitter Not supported No
StatusBar The text in the panels is right-aligned with RTL reading order Yes
TabControl Not affected by this property Yes
TextBox Displays text from right to left with RTL reading order No
Timer Not required No
ToolBar Not affected by this property Yes
ToolTip Sets the RTL reading order No
TrackBar The scroll or track starts from the right No
TreeView Sets the RTL reading order only Yes
VScrollBar Displayed on the left side rather than right side of scrollable controls No

Mirroring

Mirroring refers to reversing the layout of UI elements so that they flow from right to left. In a mirrored Windows Form, for example, the Minimize, Maximize, and Close buttons appear left-most on the title bar, not right-most.

Setting a form or control's RightToLeft property to true reverses the reading order of elements on a form, but it does not reverse the layout to be right-to-left — that is, it does not cause mirroring. For example, it does not move the Minimize, Maximize, and Close buttons in the form's title bar to the left side of the form. Similarly, some controls, such as the TreeView control, require mirroring in order to change their display to be appropriate for Arabic or Hebrew.

You cannot directly mirror a form or control. However, you can create mirroring in code. For forms, you can set an extended Windows style to cause mirroring. For most controls that require mirroring, you can create a mirrored control by inheriting from the base control and setting the same Windows extended style. You can create mirrored versions of the following controls:

ListView Panel StatusBar
TabControl TabPage ToolBar
Treeview

Some controls are sealed, so you cannot derive a new control from them. These include the ImageList and ProgressBar controls.

But there is a non-like thing. When you design a Form and put some some controls on it, the appearance during runtime will be mirrored. The control that you put it at the right of the form will be shown at the left.

History

  • 14 Nov 2003 - udpated downloads

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

A.Said

Turkey Turkey
BS(Electronics Engineer)

Comments and Discussions

 
GeneralMy vote of 1 PinmemberMohammad Rastkar28-Jul-10 2:12 
GeneralMy vote of 1 PinmemberMichael Coyle30-Mar-10 9:42 
GeneralRe: My vote of 1 Pinmemberoeatek8-Sep-10 5:36 
GeneralMy vote of 1 PinmemberMohammad Rastkar17-Mar-10 7:33 
GeneralForm Caption Mirrored when it shouldn't be PinmemberJohnGalt1722-Sep-08 4:49 
GeneralHello PinmemberHarold Dunn16-Sep-08 5:33 
GeneralEbrahim Nasr Pinmemberebrahimbaba30-Mar-07 4:11 
QuestionToolbar RTL Pinmembernighelfs18-Sep-06 5:55 
Generalrighttoleft in listbox doesnt work!!!! [modified] Pinmembernafiseh_salmani13-Aug-06 21:14 
GeneralHelp for RTL Tab Pages Pinmembersalianrakesh24-Feb-06 21:41 
GeneralRe: Help for RTL Tab Pages Pinmembereliyahubh11-Sep-13 12:19 
Generalgarbage during mouseover in right to left layout Pinmemberaudille8-Apr-05 23:18 
GeneralRe: garbage during mouseover in right to left layout PinmemberAverk11-Dec-05 1:04 
GeneralMirror Progressbar in RTL Pinsussdeepapai28-Mar-05 18:37 
GeneralMain Menu PinmemberPeer Adi15-Nov-04 22:46 
GeneralRe: Main Menu Pinmembermshoukry_alkhwarazmi29-Oct-05 23:43 
GeneralTree View PinmemberFakher Halim10-Aug-04 14:56 
GeneralRTL is not perfect ... Pinsussmorali2k22-May-04 2:44 
GeneralListView RTL Pinmemberfabis10-Mar-04 1:57 
GeneralRe: ListView RTL PinsussAnonymous20-Mar-04 6:51 
GeneralMissing Files! Pinmembertim_mcgwyn27-Sep-03 7:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 15 Nov 2003
Article Copyright 2003 by A.Said
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid