ALX
Well-known member
Once again, I get hung up on the simple stuff...
Form1 instantiates Form2 which is a help screen for Form1. Form2 does not have a titlebar and most of the form is transparent as Form2 points out various features of Form1. I've included a couple of small clickable labels in Form2 so the user can close Form2 (just the Help screen) or minimize ALL of the forms in my app if they need to shift their attention to a different application. When I minimize Form1, the system closes Form2. I want Form2 to stay active so that when the app is maximized again, everything will be as it was when the user minimized it. Here is a simplifed case which consists of two forms that each have a clickable label. The label in Form1 instantiates Form2. The label in Form2 minimizes Form1.
I'm having trouble understanding why Form2 gets closed when it's parent is minimized. 'Anybody have a cure or a workaround for this?
Thanx in advance...
Form1 instantiates Form2 which is a help screen for Form1. Form2 does not have a titlebar and most of the form is transparent as Form2 points out various features of Form1. I've included a couple of small clickable labels in Form2 so the user can close Form2 (just the Help screen) or minimize ALL of the forms in my app if they need to shift their attention to a different application. When I minimize Form1, the system closes Form2. I want Form2 to stay active so that when the app is maximized again, everything will be as it was when the user minimized it. Here is a simplifed case which consists of two forms that each have a clickable label. The label in Form1 instantiates Form2. The label in Form2 minimizes Form1.
VB.NET:
Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Dim Frm As New Form2(Me)
Frm.ShowDialog()
End Sub
End Class
'----------------------------------------------------------------
Public Class Form2
Dim Frm As Form
Public Sub New(ByRef Frm As Form)
InitializeComponent()
Me.Frm = Frm
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Frm.WindowState = FormWindowState.Minimized
End Sub
End Class
I'm having trouble understanding why Form2 gets closed when it's parent is minimized. 'Anybody have a cure or a workaround for this?
Thanx in advance...
Last edited: