Frage

I have two controls in C# that I override OnPaint() to draw all the visuals myself.

I'd like to add one of those controls inside the other.

What do I put in my parent control's OnPaint() to call the child control's OnPaint()?

War es hilfreich?

Lösung

You don't specify winforms, but that seems very likely based on your question.

You are presumably calling Invalidate() or Refresh() depending upon your heart's desire.

Refresh() on a control should make the control and its children to repaint.

If you call Invalidate(true) on a control, the child controls should also receive the invalidate message. Invalidate() without the true parameters is not recursive.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top