locked
Prevent snapping on a window (aero snap) RRS feed

  • Question

  • I am making some borderless windows that are fixed in size, and I do not want the snapping in windows 7 to occur when the user drags the window to the edge of the screen. It even locks the window down so it can never be moved again, which makes the user sad.

     

    Is this behaviour possible to prevent?

    Monday, November 22, 2010 3:34 PM

Answers

  • Thanks for the Answer. But I can't disable this for all other programs.

     

    This is was a very easy solution though that worked for me: 

     

    ResizeMode="NoResize" in Window

     

    :)

     

     

    • Marked as answer by halola Friday, December 17, 2010 10:41 AM
    Friday, December 17, 2010 10:41 AM

All replies

  • IMO that's a battle I don't think you wanna start.  You can make the window movable by using:

     

     Private Sub Window1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Me.MouseDown
        Me.DragMove()
      End Sub
    

    Monday, November 22, 2010 5:05 PM
  • Hi halola,

    This is a behaviour of Windows 7, we could change it by system, but it will be applied on all windows in the system:

    Please do the steps as follow:

    • Open the Control Panel.
    • Click on the Ease of Access Center. Then, click on either Make the mouse easier to use link.
    • Tick the check box for Prevent Windows from being automatically arranged when moved to the edge of the screen with the mouse under “Make it easier to manage windows” section.

     

    By code, we could set the registry key: WindowArrangementActive under "HKEY_CURRENT_USER\Control Panel\Desktop" to 0 to disable it.

    So I think you could code to set this registry key to 0 when user start to run your application, and change it back to 1 after user close your application.

    Sincerely,
    Bob Bao

    MSDN Subscriber Support in Forum 

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Are you looking for a typical code sample? Please download All in One Code Framework !

    如果有回复帮助并解决了您的问题,请点击 “标记为答复”,如果没有没有帮助,请随时点击“取消答复标记”
    你在为寻找代码示例而苦恼吗?赶快来下载 All in One Code Framework 微软一站式代码框架 吧!
    • Marked as answer by Jie Bao Monday, December 6, 2010 2:05 PM
    • Unmarked as answer by halola Friday, December 17, 2010 10:37 AM
    Tuesday, November 23, 2010 11:34 AM
  • Thanks for the Answer. But I can't disable this for all other programs.

     

    This is was a very easy solution though that worked for me: 

     

    ResizeMode="NoResize" in Window

     

    :)

     

     

    • Marked as answer by halola Friday, December 17, 2010 10:41 AM
    Friday, December 17, 2010 10:41 AM