wpf - How to place a button correctly on the bottom/right? -


i try place button 10px right , bottom corner. in designer button 10px corner, not in program (it 1px corner looks bit bad). bug in wpf?

<window x:class="wpftest.test"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"          xmlns:local="clr-namespace:wpftest" mc:ignorable="d" title="test"                        height="300" width="300">     <grid>         <button x:name="button" content="button" horizontalalignment="left" margin="207,239,0,0" verticalalignment="top" width="75" rendertransformorigin="-0.133,-0.75"/>     </grid> </window> 

this how looks in program this how looks in designer

you setting button based on margin. try changing button below.

<button x:name="button" content="button" horizontalalignment="right" verticalalignment="bottom" width="75" margin="10"/> 

Comments