简体   繁体   English

WPF - StackPanel 向左隐藏内容

[英]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我正在尝试在 StackPanel 中插入一个按钮列表但我想将换行内容隐藏到左边而不是右边,因为它目前正在做

在此处输入图片说明

Here my is code xaml这是我的代码 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"我认为有像“hideToLeft”这样的东西

Wrap the StackPanel inside ScrollViewer with FlowDirection property = RightToLeft使用FlowDirection 属性 = RightToLeftStackPanel包裹在ScrollViewer 中

   <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>

从右向左流动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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