内のテキスト、私はキャンバスにテキストを中央にしようと、私は何を私は現在、ここにやっていることは、この方法を、把握することはできません例えばS6
の場合はS66
に設定すれば、6を加えてその位置を保持します...キャンバス内のテキストを常に中央に置いておきたいと思います。キャンバスのアラインメントおよびSOキャンバス
また、キャンバスはStackPanel
にあります。スタックパネルの右側にあるようにしたいと思いますが、そこには行かないので、どうすれば修正できますか?
しかし、それはすべての画面に適応し、静的ではなくなるように:
<Page
x:Class="Rittensport_Software.CalculatePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Rittensport_Software"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="#E6E6E6">
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="7*"></RowDefinition>
</Grid.RowDefinitions>
<!--Navigation bar-->
<Canvas Grid.Row="0" Background="#073D48" Opacity="0.8"></Canvas>
<!--Navigation-->
<StackPanel Orientation="Horizontal">
<Image x:Name="mgBackBtn" Source="Assets/Icons/Back.png" Width="96" Height="96" />
<TextBlock Text="REKENBLAD" Foreground="#F8F8F8" FontSize="35" VerticalAlignment="Center" />
<TextBlock Text="(Deel 2)" Foreground="#F8F8F8" FontSize="35" VerticalAlignment="Center" Margin="30,0" />
</StackPanel>
<!--There we will put the main shit in (also a grid because it is difficult) -->
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<!--Top items-->
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Margin="140,41,0,0" VerticalAlignment="Top">
<TextBlock Text="Klasse" FontFamily="Verdana" FontSize="35" />
<ComboBox x:Name="ClassSelector" VerticalAlignment="Center" Margin="26,0"/>
<TextBlock Text="Nummer" FontFamily="Verdana" FontSize="35" />
<ComboBox x:Name="StartNumbers" VerticalAlignment="Center" Margin="26,0"/>
<TextBlock Text="Deel" FontFamily="Verdana" FontSize="35" />
<ComboBox x:Name="InputSegment" VerticalAlignment="Center" Margin="26,0"/>
</StackPanel>
<!--The current numer selected-->
<Canvas Background="#730D11" Width="138" Height="138" HorizontalAlignment="Right" VerticalAlignment="Center">
<TextBlock Text="S6" Foreground="#EAEAEA" FontSize="50" VerticalAlignment="Center" HorizontalAlignment="Center" Canvas.Left="45" Canvas.Top="34" />
</Canvas>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="140,0">
<TextBlock Text="Piloot:" FontWeight="Bold" FontSize="35" />
<TextBlock Text="NAAM Voornaam" FontSize="35" Margin="10,0" />
<TextBlock Text="(tel)" FontSize="25" Margin="5,9" />
<TextBlock Text="Navigator:" FontWeight="Bold" FontSize="35" Margin="306,0,0,0" />
<TextBlock Text="NAAM Voornaam" FontSize="35" Margin="10,0" />
<TextBlock Text="(tel)" FontSize="25" Margin="5,9" />
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Border BorderBrush="#707070" BorderThickness="0 1 0 0" Margin="70.5,0" />
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,60,0,0">
<TextBlock Text="Gemiste controles" Height="42" VerticalAlignment="Center" Foreground="#0F0F0F" FontSize="35" Margin="140,0,0,0" />
<TextBox PlaceholderText="100" Height="42" VerticalAlignment="Center" />
</StackPanel>
</Grid>
<Grid Grid.Row="2">
<Border BorderBrush="#707070" BorderThickness="0 1 0 0" Margin="70.5,0" />
</Grid>
</Grid>
</Grid>
私が達成したい結果は以下の通りです:ここでは、私が現在使用してコードがあります...
それはトリックでした!ありがとうございます!!!! – Robin
@Robinよろしくお願いします! –