いくつかのボタンを持つユーザー コントロールがあります。各ボタンには、コントロール内で整列/中央揃えするのに苦労しているテキストが含まれています。
私が持っているXAMLは
<UserControl x:Class="ProjectX.DetailedInfo"
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"
mc:Ignorable="d"
d:DesignHeight="28" d:DesignWidth="575">
<Grid Height="28" Width="575">
<Button Height="24" HorizontalAlignment="Left" Margin="525,2,0,0" Name="buttonOP1" VerticalAlignment="Top" Width="46" Click="buttonOP1_Click" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="11" />
</Grid>
</UserControl>
ただし、テキストが正しく配置されていません。以下を参照してください
HorizontalContentAlignment="Center"
期待どおりに機能してVerticalContentAlignment="Center"
いないようです。誰かが理由を知っていますか?
(テキストを確認しましたが、余分な文字はありません)
ありがとうございました