我是一个15岁的程序员(对此还是有点陌生),并且我已经在使用WPF的Visual Studio上编写了一个程序,这已经有几个星期了,最近,我偶然发现了这个问题
这就是我创建它时的样子
但是,当我运行该程序时,边框变得不显示在屏幕上,某些文本和其他元素重新定位,或者完全消失。 为什么会发生这种情况,我该如何解决?
到目前为止,我一直在研究其他一些qna堆栈,其中一些涉及页边距和对齐方式,其他涉及行定义和内容。我已经尝试了所有这些功能,以及它相当令人困惑的tbh。
我不知道我是否可以对此做得更简洁(似乎有点不知所措),但是这里是所讨论页面的完整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>