vb.net 2005 and MDI children

  • Thread starter Thread starter Maileen
  • Start date Start date
M

Maileen

Hi,

I have 3 forms under vb.net 2005.
MainForm (MDI parent)
Form1 (MDI child)
Form2 (MDI child)

i have a ToolStripMenu and when i click on some particular item, i open an instance of Form1 or Form2.
The particularity is that :
1. if an instance of MDI child is already opened, i show it, instead to create a new instance.
2. i want to maximize my MDI children when they are displayed, but without this ugly icon on the left side of the menu as also the minimize, reduce or
close buttons on the right side of the menu (due to maximization of my MDI child).

how can i do that ?
thanks a lot,
Maileen
 
Try this:

For each f As Form in Me.MDIChildren
If CStr(f.Tag) = "newformtag" Then
f.BringToFront()
Exit Sub
End If
Next 'f
Dim newForm as New Form1
newForm.Tag = "newformtag" 'you get the idea: each type of form will
get its own tag
newForm.MDIParent = Me
newForm.Show()

Hope this is helpful,
zdrakec
 
but what about the point 2 ?

to remove the MDI child icon which appear on the left side of the MDI parent menu when MDI child is opened ?
the same question for removing the minimize and move/normal size buttons of the MDI child when it is opened and maximized into MDI parent form ?

thanks a lot,
Maileen
 
Sorry, I didn't even notice point two, forgive me.

You can set whether the minimize, maximize, or close buttons are
visible by setting each form's properties in the IDE, or even in code:

Me.MinimizeBox = False
Me.MaximizeBox = True
Me.ControlBox = True

Also, if you look at the property window for the form, you will note
several options available for FormBorderStyle. These, and perhaps a
combination of the properties I mention above, I hope will give you
what you need.

Cheers,
zdrakec
 
Back
Top