Cómo configurar el ZIndex de un control en particular al más alto

how do i set any control to the topmost of the screen. For e.g. i have a textblock in a datatemplate or a hierarchichal data template..etc... now i would like to set this textblock to the topmost on mouseover. Setting the Grid.ZIndex value to 1 in the trigger for IsMouseOver doesn't work many times. In order to do that i set the ZIndex value for all the contols to -1 in the window. it worked in one scenario but doesn't work other times.

If anyone can get me the details of ZIndex and how to set the control to the topmost without worrying about the other controls, it would be of great help.

Note: setting the value of ZIndex to a higher value e.g. 99999 also doesn't work.

preguntado el 09 de enero de 11 a las 10:01

In future, please leave things like "WPF,XAML" in the tags. -

yeah.Sure. I used to do that for clarity and easy reference. Hereafter i would leave them in tags itself. -

1 Respuestas

ZIndex is relative to other controls in the same Panel. A number higher than another control will ensure it appears "above" that control.

If your controls aren't all in the same Panel, ZIndex won't help you. You may need to give more information on exactly what you're doing, but it sounds like an Adorner will be of more use to you.

Respondido el 28 de Septiembre de 11 a las 04:09

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.