Drawing over control children

Hi,

In Windows Forms it is virtually impossible to have a control paint over its children - overriding OnPaint doesnt help, because the children are drawn after the control itself. I've tried overriding OnRender in WPF with the same results. Is/will be this possible with WPF

Thanx.




Answer this question

Drawing over control children

  • PattiBiggs

    A Visual cannot draw over its own children, but a control can create more than one Visual. To achieve the effect that you are looking for, your control should expose a Children collection that isn't strictly a 1-1 mapping to its Visual children collection -- it would be mostly the same, except your control would add one more Visual at the end of the list. You can then add any content on that Visual and it will draw over the other child elements.

  • AlaaZaghmout

    I've just noticed that WPF plays much nicer with layered 'event transparent' controls. Thanx :)

  • Drawing over control children