C# disable aero snap for WPF window [duplicate]

北城余情 提交于 2021-02-19 04:19:19

问题


Possible Duplicate:
disable Aero Snap (wpf)

I have an application in C# WPF. I want the main window to have fixed size. To achieve this, I have set the height and max height, width and max width, to the same values. Everything looks fine, but I want also to disable Aero snap effect for this window only.

  1. The solution to disable Aero snap from Windows Registry or Control Panel is excluded.

  2. Setting the ResizeMode of the window to "NoResize" is also excluded, because in this way the window border dissapear too.

Do you have any working solution for this problem in C# ?

Thank you very much.


回答1:


You can try to change the ResizeMode to NoResize only temporarily as explained in this answer.

Otherwise you can try this trick also but I haven't tried it myself.




回答2:


I have finally found a solution, after 2 days of searching all over the Internet.

http://programminghacks.net/2009/10/19/download-snapping-sticky-magnetic-windows-for-wpf

Unfortunately it does not work with borderless windows.



来源:https://stackoverflow.com/questions/11432280/c-sharp-disable-aero-snap-for-wpf-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!