none
What's going on behind Paint OnSub?

    Question

  • Hello everyone,

    This elementary VB program with a Form and just one TextBox:

    Public Class Form1
        Protected Overrides Sub OnPaint(e As PaintEventArgs)
            MyBase.OnPaint(e)
            TextBox1.AppendText("Booo" & vbCrLf)
            e.Dispose()
        End Sub
    End Class 

    continues over time to output text in the Textbox (let it run 3-5 minutes) like this:

    I was the impression that the OnPaint Sub was run only one time at the beginning of execution. Could anybody explain? 

    Big Buzzard.


    Philippe de Marchin

    Monday, March 27, 2017 12:37 AM

Answers

All replies