ALX
Well-known member
In several forms I use an event handler for the resize event. When a particular form is minimized, I need to do a quick clean up of related forms, also displayed, to clear the screen. When the same form is then maximized, I run a process to restore those related forms. I've noticed that 'some' of the (maximize) resize events get called twice (sequentially) by the system's "external code" and others do not. This runs my restoration code twice and is a bit distracting for the user. The various forms are almost identical in their properties and code layout and yet some get maximized twice. Are there any insights out there on what causes these resize events to pop up sequentially like that and is there any way to prevent it?
VB.NET:
Private Sub Me_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
[COLOR="Green"]' "Me" is a mostly transparent form overlying the main form "Frm"[/COLOR]
If Me.WindowState <> FormWindowState.Minimized And Frm IsNot Nothing Then
Frm.Show() [COLOR="green"]' This is the main underlying form.[/COLOR]
RefreshPages() [COLOR="green"]' This is my restoration process for other related forms.[/COLOR]
End If
End Sub