Border默认透明,不响应MouseDown等事件
点击会从透明的Border穿过到下一个控件=.=(所以和ZIndex无关)
设置Background才能“点击”成功,响应MouseDown事件

WPF Border不响应MouseDown等点击事件

同理可推导,有时候需要设置容器背景为“白色”,有时候需要设置为“透明”(Transparent),看需求

示例代码

Borders

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2021-05-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-05
  • 2022-12-23
  • 2021-03-31
  • 2022-02-04
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
相关资源
相似解决方案