Я делаю программу в Visual Studio с использованием WPF и наткнулся на проблему
Вот как это выглядит, когда я создаю ее
Но когда я запускаю программу, граница выходит за пределы экрана, некоторые текстовые и другие элементы перемещаются или просто исчезают.Почему это происходит и как я могу это исправить?
До сих пор я рассматривал несколько других стековых qna, и некоторые говорят что-то о полях и выравнивании, другие о определениях строк и прочее.Я перепробовал их все и это довольно запутанно.
Я не знаю, смог бы я быть более лаконичным с этим (кажется, довольно подавляющим), но, надеюсь, вот полный код XAML для рассматриваемой страницы, надеюсь, это помогает.
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:New_EZexeat"
mc:Ignorable="d"
d:DesignHeight="560" d:DesignWidth="960"
Title="Page2">
<Grid Background="#FF8F8FF9">
<Grid.RowDefinitions>
<RowDefinition Height="249*"/>
<RowDefinition Height="311*"/>
</Grid.RowDefinitions>
<Border x:Name="signupBorder"
Background="#f2f2f2"
HorizontalAlignment="Center"
Height="498"
Width="504"
VerticalAlignment="Center"
CornerRadius="5" Margin="228,31" Grid.RowSpan="2">
<Border.Effect>
<DropShadowEffect Color="#FFA2A2A2" Opacity="0.61" BlurRadius="30" Direction="-27" ShadowDepth="16"/>
</Border.Effect>
<!-- Create Account Header -->
<Border Background="LightCoral"
Margin="0,0,0,469"
Style="{StaticResource BorderStyle1}">
<TextBlock x:Name="textinborder"
Text="Create a new account"
FontWeight="Bold"
Foreground="#f2f2f2"
FontSize="17"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Border>
<!-- Students Name -->
<TextBlock Text="Students Name"
Margin="254,73,582,0"
FontFamily="Segoe UI Semibold"
TextAlignment="Center"
FontSize="15"
VerticalAlignment="Top"
Foreground="Gray"/>
<TextBox Width="320"
Height="30"
Margin="-77,-105,0,0"
TextAlignment="Left"
FontSize="17"
Padding="0 0 0 0"
BorderBrush="Transparent"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0.5,0.5">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="324" Y="203"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<!-- School Name -->
<TextBlock Text="Name of School"
Margin="254,152,582,0"
FontFamily="Segoe UI Semibold"
TextAlignment="Center"
FontSize="15"
VerticalAlignment="Top"
Foreground="Gray"/>
<TextBox Width="320"
Height="30"
Margin="-77,-26,0,0"
TextAlignment="Left"
FontSize="17"
Padding="0 0 0 0"
BorderBrush="Transparent"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0.5,0.5">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="324" Y="203"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<!-- House Name -->
<TextBlock Text="Name of House"
Margin="254,230,582,0"
FontFamily="Segoe UI Semibold"
TextAlignment="Center"
FontSize="15"
VerticalAlignment="Top"
Foreground="Gray" Grid.RowSpan="2"/>
<TextBox Width="320"
Height="30"
Margin="-77,52,0,0"
TextAlignment="Left"
FontSize="17"
Padding="0 0 0 0"
BorderBrush="Transparent"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0.5,0.5">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="324" Y="203"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<!-- Home Address -->
<TextBlock Text="Home Address"
Margin="254,60,582,0"
FontFamily="Segoe UI Semibold"
TextAlignment="Center"
FontSize="15"
VerticalAlignment="Top"
Foreground="Gray" Grid.Row="1"/>
<TextBox Width="320"
Height="30"
Margin="-77,131,0,0"
TextAlignment="Left"
FontSize="17"
Padding="0 0 0 0"
BorderBrush="Transparent"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0.5,0.5">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="324" Y="203"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<!-- Parents Numbers -->
<TextBlock Text="Parents Numbers"
Margin="254,133,582,0"
FontFamily="Segoe UI Semibold"
TextAlignment="Center"
FontSize="15"
VerticalAlignment="Top"
Foreground="Gray" Grid.Row="1"/>
<TextBox Width="320"
Height="30"
Margin="-77,204,0,0"
TextAlignment="Left"
FontSize="17"
Padding="0 0 0 0"
BorderBrush="Transparent"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0.5,0.5">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="324" Y="203"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<TextBox Width="320"
Height="30"
Margin="-77,2,0,0"
TextAlignment="Left"
FontSize="17"
Padding="0 0 0 0"
BorderBrush="Transparent"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0.5,0.5" Grid.Row="1">
<TextBox.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="324" Y="203"/>
</TransformGroup>
</TextBox.RenderTransform>
</TextBox>
<!-- Next Button -->
<Button HorizontalAlignment="Left"
Margin="693,193,0,0"
VerticalAlignment="Top"
FontSize="50"
FontWeight="Black"
Width="76"
Style="{StaticResource CircleButton}"
Height="74"
Grid.RowSpan="2">
<Button.Effect>
<DropShadowEffect BlurRadius="24" Color="#FF6E6E6E" Opacity="0.5" Direction="553"/>
</Button.Effect>
</Button>
<TextBlock FontFamily="Segoe UI Symbol"
Text="→"
FontSize="40"
FontWeight="ExtraBold"
Foreground="#F2F2F2"
Margin="712,203,0,0"
Grid.RowSpan="2"
HorizontalAlignment="Left"
VerticalAlignment="Top"/>
</Grid>
</Page>