How to set canvas ZIndex WPF button control in Click Event?

后端 未结 3 445
醉梦人生
醉梦人生 2020-12-19 00:40

I have three buttons lying one by one. I want to show top of all button, which i click. So that I have set canvas ZIndex in XAML Code. But I want to do this in Code Behind.

相关标签:
3条回答
  • 2020-12-19 01:02

    You can set z index in code like this-

    Panel.SetZIndex(control name, int index);
    
    0 讨论(0)
  • 2020-12-19 01:17

    Z-index canbe set like this..

     Panel.SetZIndex(Button2, 10);
    
    0 讨论(0)
  • 2020-12-19 01:25

    An attached property is set from code using by convention the SetPropertyName function.

    Panel.SetZIndex(Button2, 0);
    
    0 讨论(0)
提交回复
热议问题