Maximum custom window loses drop shadow effect

前端 未结 3 662
悲哀的现实
悲哀的现实 2020-12-28 08:24

I have a custom WPF window defined as:



        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 08:39

    To create a drop shadow effect whilst having the ability to re-size the form try the following:

    1. Set the following properties on the window:

      • ResizeMode="CanResizeWithGrip"
      • AllowsTransparency="True"
      • WindowStyle="None"
      • Background="Transparent"
      • BorderThickness="3"
    2. After the window declaration, add a Border element

    3. Create a Border.Effect element inside of the border
    4. For the border effect add the following:

      
      

    This will create the following (without the control box in the top right):

    enter image description here

    Full XAML:

    
    
        
            
        
                          
    
    
    

提交回复
热议问题