0
기본적으로 응용 프로그램을 실행할 때 나타나는 둥근 모서리가있는 네 개의 빨간색 사각형이 있습니다. 모든 4의 코드는 거의 동일합니다. 문제는 처음 2 개만 나타납니다. 그리고 두 번째 것은 마지막에 잘립니다.C# WPF 모든 사각형을 렌더링하지 않습니다.
단순히 오류가 나타나지 않고 컴파일이나 런타임 예외가 나타나지 않습니다.
여기 여기 내 C# 코드 내 WPF 코드
<Window x:Class="flashing_colors.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="1200" Width="1800">
<Grid>
<Rectangle Width="200" Height="700" RadiusX="25" RadiusY="25" Name="rect1" Margin="-400,184,800,185"></Rectangle>
<Rectangle Width="200" Height="700" RadiusX="25" RadiusY="25" Name="rect2" Margin="600,184,990,185"></Rectangle>
<Rectangle Width="200" Height="700" RadiusX="25" RadiusY="25" Name="rect3" Margin="1000,184,800,185"></Rectangle>
<Rectangle Width="200" Height="700" RadiusX="25" RadiusY="25" Name="rect4" Margin="1400,184,800,185"></Rectangle>
</Grid>
</Window>
입니다.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
rect1.Fill = new SolidColorBrush(Color.FromRgb(225, 75, 75));
rect2.Fill = new SolidColorBrush(Color.FromRgb(225, 75, 75));
rect3.Fill = new SolidColorBrush(Color.FromRgb(225, 75, 75));
rect4.Fill = new SolidColorBrush(Color.FromRgb(225, 75, 75));
}
}
다음은 스크린 샷입니다. 단 2 개의 둥근 사각형을 주목하십시오.
나는 그것을 시도 할 것이다. 마진은 VS를 디자이너에서 드래그 할 때 자신의 위치를 설정하는 방법을 기본값으로 사용했습니다. –
위를 확인하십시오. – Maximus
@AlexanderRyanBaggett 왜 내가 * 결코 * 사용자 VS 디자이너 레이아웃을 조정할 수 있습니다. 컨트롤을 렌더링하는 방법을보기 위해서만 사용하기 때문에 앱을 다시 컴파일하지 않아도됩니다. –