How do you disable Aero Snap in an application?

前端 未结 11 2297
一向
一向 2020-11-29 09:36

Is it possible to disable the automatic window-docking feature of Windows 7 in a WPF application?

11条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 10:05

    If you are giving example of "Sticky Notes" of Win7, you may have noticed that it does NOT have standard window border. On that as a base, I can only tell you that there's no direct way of doing this except you set ResizeMode="NoResize" and handling the resize behavior manually. Following is a very basic, non-professional solution that i've quickly created to get you started, but you can append more functions if you like :)

    
    
        
            
                
                
                
                
            
        
    
        
            
                
                
                
            
            
                
                
                
            
    
            
    
            
    
            
    
            
    
            
    
                
                    
                
    
            
    
        
    
    

    You can even make a control (basically a panel) that can be resized and moved within its parent canvas. Now this control can be filled into a transparent maximized window. This'll give you an illusion of your control being a window that doesn't respond to 'Window Snap' and will not dock!

    Hope this helps.
    Regards,
    Mihir Gokani

提交回复
热议问题