views:

86

answers:

1

Is there a way to change the draw order of Controls in a StackPanel without changing the actual ordering of these controls in the StackPanel?

The reason I ask is that we have a button bar with margin 0 between the buttons. The active button grows (ie margin set to -10) overlapping the neighbouring buttons. The problem here is that the right button is drawn later and thus is drawn on top instead of the active button.

I'm afraid I will need to make a custom control that is grid based..

+6  A: 

Instead of changing the draw order, just set the Panel.ZIndex attached property.

Reed Copsey
or use the static method Panel.SetZIndex() in code
Wouter