0

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()?

crthompson
  • 15,653
  • 6
  • 58
  • 80
savetruman
  • 145
  • 7
  • 3
    Shouldn't have to put anything in, Invalidating a parent control, should also invalidate it's children. Was you asking in advance of seeing a problem. – Tony Hopkinson Oct 04 '13 at 20:58

1 Answers1

1

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.

Gary Walker
  • 8,831
  • 3
  • 19
  • 41