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