OnPaint

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

I have a control derived from UserControl and I have overridden the OnPaint
Sub.
All works OK except that the the OnPaint Sub always runs twice.
Can someone explain to me why this is and how can I prevent it from running
twice.

Thanks,
Fred
 
Fred said:
I have a control derived from UserControl and I have overridden the OnPaint
Sub.
All works OK except that the the OnPaint Sub always runs twice.
Can someone explain to me why this is and how can I prevent it from
running twice.

'OnPaint' can be called several times while the control is visible. When
exactly does it run twice and why are you thinking it should only be called
once?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top