MDI Framework

splicer

New member
Joined
Nov 30, 2007
Messages
2
Programming Experience
Beginner
Hi,

My issue is with building the visual framework. My application will have multiple areas that a user could be directed to depending on what menu item they select.

I'm trying an MDI enviroment, where the MDI children house the different user inputs, etc. but, I don't want the user to be able manipulate the child windows. They should remain maximized to the size of the parent at all times. In fact, the user shouldn't even know they are MDI children.

I cannot successfully remove the control buttons on the child forms and therefore don't know what to do.

Any direction would be appreciated.

Thanks
 
If I understand your query correctly, UserControls (with Dock set to fill) should be more suitable than MDI child forms. It is fairly painless to convert an existing Form to a UserControl.
 
Try this.

VB.NET:
Public Class frmMDIparent

    Private Sub Form2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form2ToolStripMenuItem.Click
        Dim f As New Form2
        f.MdiParent = Me
        SetMDIchild(f)
        f.Show()
    End Sub

    Private Sub Form3ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form3ToolStripMenuItem.Click
        Dim f As New Form3
        f.MdiParent = Me
        SetMDIchild(f)
        f.Show()
    End Sub

    'etc

    Private Sub SetMDIchild(ByRef whatForm As Form)
        whatForm.ControlBox = False
        whatForm.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
        whatForm.Dock = DockStyle.Fill
        whatForm.Text = ""
        whatForm.ShowInTaskbar = False
        whatForm.StartPosition = FormStartPosition.CenterParent
        whatForm.WindowState = FormWindowState.Maximized
    End Sub

End Class
 
Back
Top