G
Guest
Hi, I think I've come across a bug in the framework. It is to do with the
MDI behaviour of the MenuStrip control.
From my understanding once the MdiWindowListItem property of the MenuStrip
control has been assigned to a ToolStripMenuItem it should assume the
responsibility of tracking all MDI children that are opened/closed. This
behaviour seems to fail in the following scenario
If on the FormClosing event of an MDI child (for arguments sake we'll call
this FormA) the form Close is cancelled i.e. e.Cancel = true; and a new form
created (FormB) and shown/displayed, the original form FormA dissapears from
the window list and is replaced by FormB. So when FormB is closed the window
list shows no windows but yet FormA is still open.
I know this may sound a little confusing, so I've knocked up a small harness
(see link below) which reproduces this behaviour.
1. Open up the solution and start the solution
2. From the File menu select new (creates a new MDI Child window. NOTE: at
this point the window list is OK)
3. Close this form by pressing the X (a 'New Mdi Child 1 Dialog' is created.
NOTE: at this point the 'New Mdi Child 1' entry in the window list has
dissapeared)
4. Press the Cancel button on the 'New Mdi Child 1 Dialog' to close this form
http://development.gnitouch.com/MdiWindowList.zip
Thanks in advance
MDI behaviour of the MenuStrip control.
From my understanding once the MdiWindowListItem property of the MenuStrip
control has been assigned to a ToolStripMenuItem it should assume the
responsibility of tracking all MDI children that are opened/closed. This
behaviour seems to fail in the following scenario
If on the FormClosing event of an MDI child (for arguments sake we'll call
this FormA) the form Close is cancelled i.e. e.Cancel = true; and a new form
created (FormB) and shown/displayed, the original form FormA dissapears from
the window list and is replaced by FormB. So when FormB is closed the window
list shows no windows but yet FormA is still open.
I know this may sound a little confusing, so I've knocked up a small harness
(see link below) which reproduces this behaviour.
1. Open up the solution and start the solution
2. From the File menu select new (creates a new MDI Child window. NOTE: at
this point the window list is OK)
3. Close this form by pressing the X (a 'New Mdi Child 1 Dialog' is created.
NOTE: at this point the 'New Mdi Child 1' entry in the window list has
dissapeared)
4. Press the Cancel button on the 'New Mdi Child 1 Dialog' to close this form
http://development.gnitouch.com/MdiWindowList.zip
Thanks in advance