1 Attachment(s)
MenuStrip's MdiWindowListItem
More or less we do set our windowToolStripItem for this. Now, if all the MdiChilren are closed, why is it that there's a separator on the sub item of out window ToolStripItem? Is there any other property I should set for this? Something I missed or bug?
Thanks.
Re: MenuStrip's MdiWindowListItem
Re: MenuStrip's MdiWindowListItem
That would appear to be a bit of a bug. You could work around that by only having the MdiWindowListItem set if there is at least one child showing. I wrote the code in VB by accident but you should be able to get the idea and implement it yourself in C#.
vb Code:
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Dim f As New Form
f.Text = "Child " & (Me.MdiChildren.Length + 1)
Me.ShowMdiChildForm(f)
End Sub
Private Sub ShowMdiChildForm(ByVal f As Form)
'There is at least one child form.
Me.MenuStrip1.MdiWindowListItem = Me.WindowToolStripMenuItem
f.MdiParent = Me
AddHandler f.FormClosed, AddressOf Child_FormClosed
f.Show()
End Sub
Private Sub Child_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs)
If Me.MdiChildren.Length = 1 Then
'This is the last child form.
Me.MenuStrip1.MdiWindowListItem = Nothing
End If
End Sub
Re: MenuStrip's MdiWindowListItem
So it's a hack. Thanks JM, will look at it.
Re: MenuStrip's MdiWindowListItem
Quote:
Originally Posted by nebulom
So it's a hack.
:eek2: It's a workaround! ;) :)