How to create a shadow drop effect around a wpf button like the google button

后端 未结 2 840
独厮守ぢ
独厮守ぢ 2021-02-13 20:26

I am trying to create a google button in wpf. I have found the following link that specifies the google\'s button css style

Google button css style

Right now I h

2条回答
  •  没有蜡笔的小新
    2021-02-13 20:39

    You can produce a shadow drop ish effect by changing the BorderThickness some. Try something like this:

    
        
        
        
    
    

    Note that doing it this way can mess up your layout a bit, since it changes the total width and height of your button, so other controls around it may "bump around" just a tad when hovering the button.

    If you want to play around with proper drop shadow, you can add drop shadow to your button like this:

    
    

    EDIT:

    As MrDosu commented, BitMapEffect is deprecated so you should probably use Effect instead.

    Here's a sample using Effect:

    
        
        
        
            
                
            
        
    
    

提交回复
热议问题