I am designing a program that is supposed to find test examples for a problem according to certain rules. I have a small form with some text boxes for rule input. When a button is pressed this starts a new thread with the necessary calculations running at below normal priority so as not to interfere with my other processes while it does the calculations in the background.

Within this thread a new form is opened with a picture box. The results of the calculations are supposed to be viewed in this window until another valid example is found (then that one should be shown). However, when I move the window to see the original window (so that I can see the progress being made) or even just click on the window, the contents of the window go white and do not return even when other results should be drawn.

How can I change my code so that the picture remains and changes even if the window is moved around? Also, how do I prevent the closing of the picture window (Form2) from closing the other window running the calculations (Form1)?

Below is an outline of the code:

Code:
Public Class Form1

    Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click

        'Some initializing

        Dim t As Threading.Thread
        t = New Threading.Thread(AddressOf Me.Calculations)
        t.Priority = ThreadPriority.BelowNormal
        t.Start()

        'Some more stuff

    End Sub

    Public Sub Calculations
        Dim F2 As New Form2

        Do While <more calculations are to be made>

            'Some calcuations

            If <the calculations are valid> Then
                If Not F2.Created Then
                    F2.Show()
                End If
                AddHandler F2.PictureBox.Paint, AddressOf F2.PictureBox_Paint
                F2.PictureBox.Refresh()
            End If

        Loop

    End Sub

End Class

Public Class Form2

    Public Sub PictureBox_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs)

        'Draw a whole bunch of things

    End Sub

End Class