Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

similarly,
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:

VB
Public Class Form1


    Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
        Me.Close()
    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.Show()
        Else
            frmFile.MdiParent = Me
            frmFile.Activate()
        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.Show()
        Else
            frmSend.MdiParent = Me
            frmSend.Activate()
        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
        frmSettings.Show()
    End Sub
End Class




This is Add Form Code
VB
Public Class Add

End Class



This is Send Form Code
VB
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,
Rohith.
Posted
Updated 23-Mar-13 9:56am
v3
Comments
[no name] 23-Mar-13 15:46pm    
Your problem might become clearer if you post the code that you have tried that demonstrates your problem.

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??
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900