Numbers are not displayed properly when using Arabic culture with Right-to-Left (RTL) flow direction in WPF.

Vignesh 0 Reputation points
2024-05-02T13:12:21.38+00:00

When using a textbox in Arabic culture with RTL, numbers are displayed in Arabic numerals. However, I want them to be displayed in standard numerals only.

FlowDirection="LeftToRight":

User's image

FlowDirection="RightToLeft":

User's image

Code Snippets:

<StackPanel FlowDirection="RightToLeft"> 
     <TextBox Text="23.00" Width="100" Height="35"/>
</StackPanel>

C#:
Thread.CurrentThread.CurrentCulture = new CultureInfo("ar");
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,685 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 112.8K Reputation points
    2024-05-02T19:02:32.52+00:00

    Check an alternative:

    <StackPanel FlowDirection="RightToLeft">
        <RichTextBox Width="100" Height="35">
            <FlowDocument>
                <Paragraph>
                    <Run>23.00</Run>
                </Paragraph>
            </FlowDocument>
        </RichTextBox>
    </StackPanel>