简体   繁体   中英

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

在此处输入图片说明

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"

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>

从右向左流动

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM