How to set ZIndex of a specific control to the topmost

how to install any control at the very top of the screen. E.g. I have a textblock in a datatemplate or hierarchical data template..etc ... now I would like to set this text block at the very top moment on the mouse. Setting the Grid.ZIndex value to 1 in a trigger for IsMouseOver does not work many times. To do this, I set the ZIndex value for all loops -1 in the window. It worked in one scenario, but does not work in another time.

If anyone can get me information about ZIndex and how to set the control to the very top without worrying about other controls, this will be very helpful.

Note: setting the ZIndex value to a larger value, for example. 99999 also does not work.

+4
source share
1 answer

ZIndex refers to other controls in the same Panel . A number higher than that of another control ensures that it will be displayed "higher."

If your controls are not all in the same Panel , ZIndex will not help you. You may need more information about what you are doing, but it looks like Adorner will be more useful to you.

+4
source

Source: https://habr.com/ru/post/1334810/


All Articles