我无法在默认按钮上垂直居中文本(未使用样式或模板)
我看到了像这样的线程
^^ 我没有在按钮 1 中设置任何文字高度。
不确定是什么导致了这种行为,以及当本地化出现时如何有效地摆脱它。
我知道我可以设置一个 -ve 边距来精确对齐文本,但这可能会导致另一种语言的错误。这是基于默认字体系列表达式混合的一些限制吗?
对此的任何帮助都会很棒。似乎微不足道,但似乎无法为导致这种行为的原因找到一个体面的解释。
Xaml 代码如下:
<Window x:Class="TestButton.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Button Content="ButtonFFAH" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" VerticalContentAlignment="Center"/>
<Button Content="ButtonAH" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75"
Margin="80,0,0,0" Height="15.627" VerticalContentAlignment="Center"/>
</Grid>