WPF - StackPanel Hide Content to Left

I'm trying to insert an list of button in a StackPanel But I'd like to hide the wrap content to left instead of right, as it is currently doing

enter image description here

Here my is code xaml

<StackPanel Orientation="Horizontal" >
    <Button Width="50">1.5678</Button>
    <Button Width="50">1.5678</Button>
    <Button Width="50">1.5678</Button>
    <Button Width="50">1.5678</Button>
    <Button Width="50">1.5678</Button>
    <Button Width="50">1.5678</Button>
    <Button Width="50">1.5678</Button>
    <TextBox x:Name="EDT_NUMERO_CFOP" Style="{StaticResource TextBoxNoBorder}" Height="30"></TextBox>
</StackPanel>

I think that there's something like "hideToLeft"

Upvotes: 1

Views: 454

Answers (1)

na th
na th

Reputation: 145

Wrap the StackPanel inside ScrollViewer with FlowDirection property = RightToLeft

   <ScrollViewer CanContentScroll="True" FlowDirection="RightToLeft">
    <StackPanel Orientation="Horizontal" Margin="0,0,6,6.5" >
        <Button Width="50">1.5678</Button>
        <Button Width="50">1.5678</Button>
        <Button Width="50">1.5678</Button>
        <Button Width="50">1.5678</Button>
        <Button Width="50">1.5678</Button>
        <Button Width="50">1.5678</Button>
        <Button Width="50">1.5678</Button>
        <TextBox x:Name="EDT_NUMERO_CFOP" Style="{StaticResource TextBoxNoBorder}"  Height="30"></TextBox>
    </StackPanel>
</ScrollViewer>

flow from right to left

Upvotes: 2

Related Questions