gpt4 book ai didi

窗口上的 WPF 布局

转载 作者:行者123 更新时间:2023-12-04 12:44:03 24 4
gpt4 key购买 nike

我在 WPF Windows 上有几个列表框,带有 Height="Auto" Width="Auto"在表格上设置

表单大小在不同分辨率下完美匹配,但问题是当我按下最大化按钮时,在表单调整大小时会看到一个粗的“黑色 L”。我已经在很多 WPF 应用程序中看到了这一点,但直到现在还没有解决这个问题。

有没有办法在窗体上的控件调整大小时对窗口进行 DoubleBuffer 缓冲,或在 WPF 中调用 SuspendLayout()?我怎样才能摆脱这个丑陋的黑色L?

最佳答案

引用最近的一篇Hanselminutes :

Ian Griffiths: ... There's the win32 cue which is an ordinary win32 message loop, and WPF pools messages off of that and puts them on it's own cue and then deal with it on it's own sweet time, partly because it wants to be able to reorder the events as they come in. It will prioritize certain things above input processing, for example, and that, by the way, is why you get the slightly bizarre repaint handling on resizing WPF applications, you may have noticed you get a little bit of blank space appearing temporarily when you resize a window it's because it's acknowledging the resize event before it actually really does anything with it and then the paints happen slightly out of sync with what's normally there. So there is a win32 message queue but it's not actually the main message queue in WPF and that‘s all sort of implementation details the dispatcher tries to hide as much about it as possible.



尽管我不知道完整的解决方案,但它似乎与您的问题有关。
也许,您应该尝试更改一些 Dispatcher 优先级?

关于窗口上的 WPF 布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1406244/

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