ALX
Well-known member
I can get hung up on the simplest stuff. I've got a base form class that contains one of many other form classes that are added to the base form's controls collection and anchored to the boarders of the base form. When the base form is resized, the child form resizes along with the base form nicely. The child form also handles the resize event by resizing all of its controls to accommodate the new size. There is also one more modal form class that acts as a Help page. In the base form's resize event handler, the base form raises an event to also resize the Help form. It seems that this event is being called before the base form's child has been redrawn to the new size, and the help form needs to know the new sizes of the underlying form and controls in order to display properly. I've tried variations on the base form's resize event handler to try to force the base form's contained child form to update before raising the event for the Help page without success. I realize I could raise another event in the child form to update the Help form, but I'm trying to keep the code as simple and compact as possible as there are many different form classes that could be the child form (but only one at a time).
'A simplified version below...
Private Sub Me_Resize(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.WindowState <> FormWindowState.Minimized Then
Me.Refresh ' Also tried Me.Invalidate, Me.Update...
Application.DoEvents() ' I thought this might force the repaint of the Child form... Nope !
RaiseEvent HelpResize() ' This event is raised before the base form's child has resized. I need to force
' all forms and controls to complete the resizing before this event is raised.
End If
End Sub
What I need is a statement like "Me.ChildForm.Refresh" or "Me.OwnedForms.Update" which, of course, is not an option. 'Any ideas ???
'A simplified version below...
Private Sub Me_Resize(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.WindowState <> FormWindowState.Minimized Then
Me.Refresh ' Also tried Me.Invalidate, Me.Update...
Application.DoEvents() ' I thought this might force the repaint of the Child form... Nope !
RaiseEvent HelpResize() ' This event is raised before the base form's child has resized. I need to force
' all forms and controls to complete the resizing before this event is raised.
End If
End Sub
What I need is a statement like "Me.ChildForm.Refresh" or "Me.OwnedForms.Update" which, of course, is not an option. 'Any ideas ???