locked
How to put the button's real border to the Grid's border? RRS feed

  • Question

  • The button's control border is different from control border.How to put the button's real border to the Grid's border?
    Monday, March 10, 2014 1:35 PM

Answers

All replies

  • What you want is to align the button as same as to the grid?
    Monday, March 10, 2014 2:10 PM
  • What do you mean by "different"?

    Maybe "not aligned properly"?


    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    Monday, March 10, 2014 2:11 PM
  • Monday, March 10, 2014 2:22 PM
  • First of all why do you need to combine both...

    Either have a button or a Grid?

    If you're having any one of the above, then you can add the Border control to the element...

      <Border  BorderBrush="Black" BorderThickness="5" Margin="5,0,-18,0" >
                    <Grid  Margin="5,0,5,-6" Height="400" />
    </Border>
    
    


    Happy Coding...
    Monday, March 10, 2014 2:28 PM
  • That line should be aligned with what?

    By the way, that space you see there is the so called touch target, I think it is 7 pixels on each side and is used to accommodate your thumb size.

    If you are really keen on changing it, you must edit it's control template.


    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    Monday, March 10, 2014 2:29 PM
  • That line should be aligned with Grid's vertical line.

    Thanks.

    Monday, March 10, 2014 2:36 PM
  • Then adjust the Margin until it is aligned. You do know that there is a Margin property and what it does?

    Toni Petrina
    My blog: Toni codes .NET
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful"

    Monday, March 10, 2014 2:44 PM
  • You can manually adjust the Margin property or else just drag the Button border to align with the Grid or you can do it vice verca according to your wish as Toni said....
    Monday, March 10, 2014 2:46 PM
    • Marked as answer by yang2013yang Wednesday, March 12, 2014 9:11 AM
    Monday, March 10, 2014 3:28 PM