Mouse event on transparent background

后端 未结 3 1068
臣服心动
臣服心动 2020-12-03 18:00

I have create several canvas with transparent background and wanna make some move event on it.

However, I found that all mouse event (e.g. MouseLeftButtonDown) canno

3条回答
  •  温柔的废话
    2020-12-03 18:40

    Transparent DOES react to mouse events, that's the whole point of it, are you sure that you are even hitting the canvas?

    Here's a XAML-only example:

      
        
            
                
                    
                        
                            
                                
                            
                        
                    
                
            
        
      
    

    If you set the Background to null, either explicity or implicitly by removing the property it will no longer react.

提交回复
热议问题