我刚刚从WinForms切换到WPF今天。
我现在面临的问题是,在某个点之后,当我运行应用程序(在设计器中我看到所有内容)时,下面的所有内容都会被切断。WPF窗体切断一切点下面的所有内容
宽度为1920,高度为1080我使用WindowState="Maximized"
,也许这是为什么呢?
我想创建一个应用程序,全屏,但再次 - 某一点后,下面一切都被切断,当我运行应用程序 我只是想将它们放在哪里,并为他们留没有什么特别的。那么,也许不需要“网格”?
这里的XMAL代码:
<Window x:Class="KodeOS.MainWindow"
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:KodeOS"
mc:Ignorable="d"
Title="KodeOS" Height="1080" Width="1920" WindowStartupLocation="CenterScreen" WindowState="Maximized" WindowStyle="None">
<Grid>
<Grid.Background>
<ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/kdroid_wallpaper1.png"/>
</Grid.Background>
<Label x:Name="label" Content="KodeOS" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Segoe Print" FontSize="18.667" Margin="10,0,0,0" Foreground="White"/>
<Label x:Name="label1" Content="by Kamil" HorizontalAlignment="Left" Margin="10,24,0,0" VerticalAlignment="Top" FontFamily="Segoe Print" Foreground="White"/>
<Button x:Name="button" Content="After here everything will be cut off" HorizontalAlignment="Left" Margin="18,665,0,0" VerticalAlignment="Top" Width="255" RenderTransformOrigin="0.526,-0.807" Height="44"/>
<Button x:Name="button_Copy" Content="I'm past the cut off zone" HorizontalAlignment="Left" Margin="37,814,0,0" VerticalAlignment="Top" Width="179" RenderTransformOrigin="0.526,-0.807" Height="30"/>
</Grid>
[这个简单的教程可能有帮助](http://www.wpf-tutorial.com/panels/grid/) – nabulke
@nabulke我不认为添加网格将有所帮助。也许你可以尝试运行它,看看问题是什么?它也感觉像控制(按钮,标签等)的位置可能比我在设计师看到的更低? – Kamdroid
你已经在你的例子中_had_ a'Grid'。链接解释了如何正确使用它,以及为什么它现在产生错误的结果。 – nabulke