0
我在Visual Studio中玩WPF,我有這個奇怪的問題。我製作了一個網格,佔用了主窗口的大約50%。這個網格將成爲我的俄羅斯方塊遊戲發生的地方。窗口Id的另一半喜歡顯示顯示分數等的標籤。但沒有任何東西出現,只是網格內容。有沒有人有任何想法可能會導致這個問題? 繼承人我XAML代碼:C#WPF窗口不顯示元素
<Window x:Class="Tetris_Final.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:Tetris_Final"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="500" KeyDown="Window_KeyDown">
<Grid x:Name="GridPlayBoard" Width="255" Height="405
" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,0,0">
<Button x:Name="button" Content="Start game!" HorizontalAlignment="Left" Margin="337,148,-177,0" VerticalAlignment="Top" Width="95" Height="48"/>
<Label x:Name="label" Content="Label" HorizontalAlignment="Left" Margin="337,48,-214,0" VerticalAlignment="Top" Width="132" Height="42"/>
</Grid>
謝謝你的工作完美! – Heisenberker