WPF窗体闪烁的一种解决办法


参考:Prevent WPF window flicker

You can use a transparent window (AllowTransparency = True) with a grid, then when your control needs to be hidden you can set the visibility of the control to collapsed. There will be no flickering and no moving of the window but there won't be anything there either so you will see throug as if you would have resized, moved your window.

某些时候,弹出的窗体会闪烁,这着实让人难受,通过给要弹出的窗体设置AllowTransparency为True,对闪烁问题有一定的缓解。

 

 


2021.01.19 补充

某些情况下,设置窗体的ResizeMode="NoResize" 也能缓解闪烁问题

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM