gpt4 book ai didi

wpf - WPF DatePicker 奇怪的外观

转载 作者:行者123 更新时间:2023-12-01 10:00:01 24 4
gpt4 key购买 nike

在 .NET 4.0 上的 WPF 应用程序中,我使用了两个 DatePicker s 和两个 TextBlock s 水平 StackPanel ,它看起来像这样:

enter image description here

在左边 DatePicker ,我尝试了更大的字体大小。除此之外,没有特殊的设置或样式。

按钮与 TextBlock 对齐s,但 DatePicker 中的文字不是。

知道如何更改日期文本的对齐方式吗?

编辑:这是我的 XAML:

    <StackPanel Orientation="Horizontal"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
>
<TextBlock Text="from " />
<DatePicker SelectedDate="{Binding FromDate, Mode=TwoWay}" FontSize="14" />
<TextBlock Text=" until " />
<DatePicker SelectedDate="{Binding ToDate, Mode=TwoWay}" />
</StackPanel>

最佳答案

谢谢 Jorge,这是一个 Button App.xaml 中的样式:

    <Style TargetType="{x:Type Button}">
<Setter Property="Margin" Value="0 5 10 5" />
</Style>

此样式应用于 DatePicker 内部的按钮以及。

关于wpf - WPF DatePicker 奇怪的外观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17558439/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com