0
我在Visual Studio 2017(Visual C#)上創建一個簡單的WPF應用程序。 我有這樣的形式:佈局問題與可視c#
<Window x:Class="HelloWPFApp.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:HelloWPFApp"
mc:Ignorable="d"
Title="Greetings" Height="350" Width="525">
<Grid Height="319" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="192*"/>
<RowDefinition Height="41*"/>
<RowDefinition Height="86*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Select a message option and then choose the Display button." VerticalAlignment="Center" Height="16" Width="329" Margin="102,131,86,45"/>
<RadioButton x:Name="rbHello" Content="Hello" HorizontalAlignment="Left" Margin="102,2,0,0" VerticalAlignment="Top" Height="15" Width="47" Grid.Row="1"/>
<RadioButton x:Name="rbGoodbye" Content="Goodbye" HorizontalAlignment="Left" Margin="337,2,0,0" VerticalAlignment="Top" Height="15" Width="67" Grid.Row="1"/>
<Button Content="Display" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="231,2,0,0" Click="Button_Click" Height="20" Grid.Row="2"/>
</Grid>
</Window>
爲什麼這樣做?我該如何解決它? (這是Microsoft Documentation的示例!)
這看起來像WPF,不是的WinForms。您提供的鏈接是以WPF爲例。 –
對不起,WPF是正確的,我有點困惑 – Rik99