vb.net 2005 and MDI children

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maileen

    #1

    vb.net 2005 and MDI children

    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
  • zdrakec

    #2
    Re: vb.net 2005 and MDI children

    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.MDIPare nt = Me
    newForm.Show()

    Hope this is helpful,
    zdrakec

    Comment

    • Maileen

      #3
      Re: vb.net 2005 and MDI children

      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

      zdrakec wrote:[color=blue]
      > 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.MDIPare nt = Me
      > newForm.Show()
      >
      > Hope this is helpful,
      > zdrakec
      >[/color]

      Comment

      • zdrakec

        #4
        Re: vb.net 2005 and MDI children

        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

        Comment

        Working...