2015-04-16 48 views
1

你好我工作的POS(銷售點)系統,我在下文提到的圖像顯示訂單哪個控件sutiable在WPF創建動態電網

enter image description here

我曾嘗試與包裹面板,但它會產生像

enter image description here

看到它會採取最大高度爲所有網格我想要實現的image1的任何人都可以請幫完全相同的網格,其WPF控件是suitab樂來完成它。

回答

1

頂部圖片看起來像一個垂直於我的包裝面板。

Screenshot

MainWindow.xaml

<Window x:Class="WpfApplication24.MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Background="Black" 
    Title="MainWindow" Height="350" Width="525"> 
<Window.Resources> 
    <Style TargetType="TextBlock"> 
     <Setter Property="Margin" Value="5" /> 
     <Setter Property="Foreground" Value="Black" /> 
    </Style> 
    <Style TargetType="StackPanel"> 
     <Setter Property="Width" Value="100" /> 
     <Setter Property="Margin" Value="5" /> 
     <Setter Property="Background" Value="Red" /> 
    </Style> 
</Window.Resources> 
<WrapPanel Orientation="Vertical"> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
    <StackPanel> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
     <TextBlock Text="A Line" /> 
    </StackPanel> 
</WrapPanel> 

+0

嘿,這是偉大的,讓我嘗試用它太感謝你了....... –