解决方案 »

  1.   

    用Grid,设置多列
    然后每个控件的horizonalignment设置为stretch
      

  2.   

    我要设置的是控件宽度  不是设置列  是一堆控件  不是一堆列@hbu pig
      

  3.   

    里边放一个Grid,所有空间都写在Grid里
      

  4.   

    源代码
    <Window x:Class="WpfApplication1.Window1"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="计算器" Height="350" Width="1000">
        <Grid Height="300" Width="900">
            <StackPanel  Orientation="Horizontal" >
                <Button>Button A</Button>
                <Button>Button B</Button>
                <Button>Button C</Button>
                <Button>Button D</Button>
                <Button>Button E</Button>
                <Button>Button F</Button>            
            </StackPanel>    </Grid></Window>
      

  5.   

    上面都告诉你了,布局用Grid分好列,把Button放到Grid里