Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Visual Basic (Classic) FAQ


"Maximized" MDI Child without Controlboxes VB 2005 by VBRob
Posted: 19 Jan 06

Our company needed an MDI form where the children were always maximized and would not let the user minimize or restore the children forms. Also needed to be able to navigate between the child forms.

Setting the children's Controlbox, MinBox and MaxBox to false also setting the windowstate = Maximize and FormBorderStyle = None didn't work.  The parent still contained the control boxes to minimize, restore or close the child form.

After trying several variations, we came up with the following solution which worked exactly the way we needed it to.  Simply create a project with three forms setup as specified below.  It should look similar to this:

  Form1 Properties:
    IsMdiContainer = True

  Listbox1 docked to left of Form1.
  ImageList1 contains one image.

  Form2 and Form3 Properties:
    WindowState = Normal

  Form2 has a label with Label1.Text = "2"

  Form3 has a label with Label1.Text = "3"



Public Class Form1
    Dim frm2 As New Form2
    Dim frm3 As New Form3

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        frm2.MdiParent = Me
        frm2.Dock = DockStyle.Fill
        Me.ListView1.Items.Add(frm2.Text, 0)
        frm3.MdiParent = Me
        frm3.Dock = DockStyle.Fill
        Me.ListView1.Items.Add(frm3.Text, 0)
    End Sub

    Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
        Dim lv As ListView = CType(sender, ListView)

        Select Case lv.FocusedItem.Text
            Case frm2.Text
            Case Else

        End Select
    End Sub
End Class

Back to Visual Basic (Classic) FAQ Index
Back to Visual Basic (Classic) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close