gpt4 book ai didi

C# WPF - 窗口中的黑线

转载 作者:太空狗 更新时间:2023-10-29 21:14:54 25 4
gpt4 key购买 nike

在我的窗口中有一条小黑线。为什么?

Screenshot

<Window x:Class="WpfPortOfTestingCamera.InputSelection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="InputSelection" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" SizeToContent="WidthAndHeight" d:DesignWidth="280" d:DesignHeight="206">

<StackPanel HorizontalAlignment="Center" Name="stackPanel1" VerticalAlignment="Top" Margin="10" MaxWidth="500">
<GroupBox Header="Select Camera" HorizontalAlignment="Center" VerticalAlignment="Center">
<ComboBox Height="23" Name="comboBox1" HorizontalAlignment="Center" VerticalAlignment="Center" MinWidth="120" />
</GroupBox>
<Button Content="OK" Name="ButtonOK" IsDefault="True" Click="ButtonOK_Click" />
</StackPanel>
</Window>

最佳答案

这似乎是在设置内容字符串后将窗口调整为组合框的宽度时出现的渲染伪像。

如果您将属性 SnapsToDevicePixels="True"添加到 Window-tag,黑线就会消失。

关于C# WPF - 窗口中的黑线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4686360/

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