2013-06-03 39 views

回答

3

將它放到個人Grids,使用列具有共同SharedSizeGroup,並設置Grid.IsSharedSizeScopetrueStackPanel

+2

1+的解決方案,但一些樣品的標記將是完美的。 –

+1

@HighCore:冗餘,在文檔中足夠了。 –

+1

一切都在文檔中,所以stackoverflow是多餘的... – sebesbal

1

通常文檔不能很快理解,因爲它是以一種令人困惑的方式編寫的,或者所需的信息隱藏在大量其他信息中,而這些信息在特定情況下不起作用。所以,在我看來,即使它是一個「基本的東西」,對於快速回答也沒有什麼壞處(或者如果人們認爲它太原始,他/她應該只是不發表任何內容)。

 <StackPanel Orientation="Horizontal" Grid.IsSharedSizeScope="True"> 
      <Grid> 
       <Grid.ColumnDefinitions> 
        <ColumnDefinition SharedSizeGroup="MySizeGroup" /> 
       </Grid.ColumnDefinitions> 
       <Button Height="23" Content="Reset" Padding="5,1" /> 
      </Grid> 
      <Grid> 
       <Grid.ColumnDefinitions> 
        <ColumnDefinition SharedSizeGroup="MySizeGroup" /> 
       </Grid.ColumnDefinitions> 
       <Button Height="23" Content="Set" Padding="5,1" /> 
      </Grid> 
      <Grid> 
       <Grid.ColumnDefinitions> 
        <ColumnDefinition SharedSizeGroup="MySizeGroup" /> 
       </Grid.ColumnDefinitions> 
       <Button Height="23" Content="Import" Padding="5,1" /> 
      </Grid> 
      <Grid> 
       <Grid.ColumnDefinitions> 
        <ColumnDefinition SharedSizeGroup="MySizeGroup" /> 
       </Grid.ColumnDefinitions> 
       <Button Height="23" Content="Export" Padding="5,1" /> 
      </Grid> 
      <Grid> 
       <Grid.ColumnDefinitions> 
        <ColumnDefinition SharedSizeGroup="MySizeGroup" /> 
       </Grid.ColumnDefinitions> 
       <Button Height="23" Content="Create new" Padding="5,1" /> 
      </Grid> 
     </StackPanel> 

希望這有助於:)

相關問題