I've got a "Loading" form which I display as a modal form when doing lengthy processes. I'm using the below to keep the form centred within the child form performing the process. However, when minimising\maximising the "Loading" form appears before the parent making it look a little unprofessional.
Anything I can do about that (Delay it appearing or attaching it in a different way)?
Private _childForm As FormBusy
Private Const NIM_DELETE = &H2
Private Sub SetChildFormPosition()
If _childForm Is Nothing Then
Return
End If
Dim newLocation As New Point()
newLocation.X = Me.Location.X + ((Me.Width - _childForm.Width) \ 2)
newLocation.Y = Me.Location.Y + ((Me.Height - _childForm.Height) \ 2)
_childForm.Location = newLocation
End Sub
Private Sub ParentForm_LocationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LocationChanged
SetChildFormPosition()
End Sub