OnPaint

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fred

    OnPaint

    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


  • Herfried K. Wagner [MVP]

    #2
    Re: OnPaint

    "Fred" <nospam@please. com> schrieb:[color=blue]
    >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.[/color]

    '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?

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    Working...