私はBlend/VS2012 IDE
中とDebugging
で異なる外観に問題を抱えています。 IDE
では、Rectangle
が中央にありますが、コンパイルまたはデバッグするとマージンのサイズが異なります。私の見解では、これはウィンドウ境界のサイズが異なるために発生します。私は本当にこの問題を解決したい。助言がありますか?
ありがとうございます。
XAML
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="202" Width="194">
<Grid HorizontalAlignment="Left" Height="171" VerticalAlignment="Top" Width="186">
<Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="151" Margin="10,10,0,0" Stroke="Black" VerticalAlignment="Top" Width="166"/>
</Grid>
編集XAML
コード:
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="202" Width="194">
<Grid HorizontalAlignment="Left" Height="171" VerticalAlignment="Top" Width="186">
<Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Center" Height="151" Margin="10" Stroke="Black" VerticalAlignment="Center" Width="166"/>
</Grid>
結果は同じです。私のPCのこの問題ですか?
xamlコードを提供できますか? – Xelom
Xelom、xamlコードを追加しました。ご清聴ありがとうございました。 – jn4kim
マージンを「マージン」=「10」に変更し、「水平」と「垂直方向」を「ストレッチ」または「中央」に設定します。 –