Click here to Skip to main content
12,997,531 members (58,269 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hi all,

I'm working with MDI Application and Creating Menus in it. I have come across an issue explained below.

1) we have a child window (say Send Form) having property WindowState as Maximized.
2) another child window (say Add Form) having property WindowState as Normal.

Now the issue is when I first open Send Form it appears maximized state but next when I open Add form both Add Form and Send Form are in MAXIMIZED state.

when I First open Add Form then I open Send Form and then I get Focus (by using objAddForm.Activate()) back to Add Form now both Child Forms are in NORMAL state.

This is Parent form code:

Public Class Form1

    Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
    End Sub
    Dim frmFile As Add
    Private Sub AddToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AddToolStripMenuItem.Click
        If frmFile Is Nothing Then
            frmFile = New Add()
            frmFile.MdiParent = Me
            frmFile.MdiParent = Me
        End If

    End Sub
    Dim frmSend As Send
    Private Sub SendToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SendToolStripMenuItem.Click
        If frmSend Is Nothing Then
            frmSend = New Send()
            frmSend.MdiParent = Me
            frmSend.MdiParent = Me
        End If
    End Sub
    Dim frmSettings As Settings
    Private Sub SettingsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SettingsToolStripMenuItem.Click
        frmSettings = New Settings()
        frmSettings.MdiParent = Me
    End Sub
End Class

This is Add Form Code
Public Class Add
End Class

This is Send Form Code
Public Class Send
End Class

I have just started the application just to know how MDI is implemented so you can't find much code in it.

Pls help me.

Please suggest me a solution for it.

Sorry, if any one feels my English is bad.

Thanks in Advance,
Posted 23-Mar-13 9:43am
Updated 23-Mar-13 9:56am
ThePhantomUpvoter 23-Mar-13 15:46pm
Your problem might become clearer if you post the code that you have tried that demonstrates your problem.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

What you describe is the expected behavior. If one child window is maximized, they ALL become maximized. If one is normal, they all become normal.

MDI stands for Multiple DOCUMENT interface, not Multiple Window. You're using MDI for a purpose it was not designed for.

It's designed to be used as something of a text editor, where you have multiple windows open, all doing the exact same thing, editing documents. Your app isn't doing that, is it??
rohith reddy vadiyala 24-Mar-13 3:54am
yes, but can you please suggest me some alternative for my issue.
Dave Kreskowiak 24-Mar-13 11:34am
What issue?? What you're seeing can NOT be resolved because it's how MDI works!

You have to completely restructure your application to NOT use MDI to get around this.
rohith reddy vadiyala 25-Mar-13 4:13am
Thank you for your Reply.. @Dave

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170622.1 | Last Updated 23 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100