Is there a way in C# where we can print Right-to-left languages like Arabic so that output is right-to-left, not just right aligned.
This HTML like snippet might be helpful in explaining the requirement:
<div style="direction:rtl;">كمشنيش (شسي شسي)</div> <!-- correct -->
<div style="text-align:right;">كمشنيش (شسي شسي)</div> <!-- just right aligned -->
I want my application to look like the first div.
If you're using WinForms
, set the form's RightToLeft property to RightToLeft.Yes
. Any control on the form will automatically inherit that property by default. If you only want certain controls to have that property then you can set that individually for each control.
If you're using Silverlight 4, you can set the FlowDirection property.
<TextBox FlowDirection="RightToLeft" ... />
There's more information about Right to Left text in Silverlight here.