'FORM2 CODE
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'this will help since the app still kind of stalls while loading
Me.Cursor = Cursors.WaitCursor
End Sub
Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
Static AlreadyRan As Boolean
'make sure it only fires once
If Not AlreadyRan Then
Me.Owner.Hide()
Me.Cursor = Cursors.Default
AlreadyRan=True
End If
End Sub
Private Sub Form2_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
'bring back old form
Me.Owner.Show()
End Sub
'FORM1 CODE
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'show busy
Me.Cursor = Cursors.WaitCursor
Dim frm As New Form2()
'pass me as the owner
frm.ShowDialog(Me)
'remove busy
'note cursor for this form is not shown while the form is hidden
Me.Cursor = Cursors.Default
End Sub