vb.net 2005 and MDI children

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
 
Z

zdrakec

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
 
M

Maileen

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
 
Z

zdrakec

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
 

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