MDI Form mdiList for experts

A

andreas

I have a MDI form with a MdiList in a MenuItem
And also 3 different child types, one child is like a background with a
picturebox in it.
So this must be always as background and never hide the others childs.
But when I click in the MdiList on the "backgroundchild" the
"backgroundchild hides the others child.
Can I remove this child from the MdiList or is there a way that this child
don't hide the others when clicking on it in the MdiList?
Thanks for any response
 
N

NickP

Hi Andreas,

One thing you could do is implement your own MDI list in the menu. This
would require you to add / remove menu items that link to the child forms
when created / destroyed.

For example,

Dim newmenitem As New ToolStripMenuItem("new window!")
newmenitem.Tag = <child form object>
AddHandler newmenitem.Click, AddressOf newmenitem_Click
<toolstripmenuitem to store MDI list>.DropDownItems.Add(newmenitem)

Private Sub newmenitem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim menuitem As ToolStripMenuItem = CType(sender, ToolStripMenuItem)
menuitem.Tag = <associated child form object>
End Sub

In the click event you could then hide all child forms except for your
background one, and show the associated child form object. In the "enter"
event of your background form you could call Me.SendToBack() in order to
force it to the back each time.

Remember to keep a hashtable with the child forms as keys and the menu
items as the values, this way you can easily remove the menu items when the
form is created...

Hashtable.Item(Me) << Returns menu item for current child form.

I hope this helps.

Nick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top