2016-05-19 2 views
0

Как поместить пробел между кнопками? Я использую Относительную панель, и я первая Выравнивает кнопку с центром панели, и не хочу кнопки, чтобы быть вместе, как на картинке:Установите кнопки расстояния

enter image description here

<RelativePanel> 
      <Button Name="Button1" 
        Content="Button 1" 
        RelativePanel.AlignHorizontalCenterWithPanel="True" 
        RelativePanel.AlignVerticalCenterWithPanel="True"/> 
      <Button Name="Button2" 
        Content="Button 2" 
        RelativePanel.AlignHorizontalCenterWithPanel="True" 
        RelativePanel.AlignVerticalCenterWithPanel="True" 
        RelativePanel.Below="Button1"/> 
      <Button Name="Button3" 
        Content="Button 3" 
        RelativePanel.AlignHorizontalCenterWithPanel="True" 
        RelativePanel.AlignVerticalCenterWithPanel="True" 
        RelativePanel.Below="Button2"/> 
    </RelativePanel> 

ответ

1

Один из Опции - установить маркер кнопок. напр:

<Button Name="Button1" 
     Content="Button 1" 
     RelativePanel.AlignHorizontalCenterWithPanel="True" 
     RelativePanel.AlignVerticalCenterWithPanel="True" 
     Margin="5"/> 

Это означает, что первая кнопка будет иметь полей равные 5 пикселей с каждой стороны.

Смежные вопросы