Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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:
 
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
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,
Rohith.
Posted 23-Mar-13 10:43am
Edited 23-Mar-13 10:56am
v3
Comments
ThePhantomUpvoter at 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
good
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??
  Permalink  
Comments
rohith reddy vadiyala at 24-Mar-13 3:54am
   
yes, but can you please suggest me some alternative for my issue.
Dave Kreskowiak at 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 at 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
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 23 Mar 2013
Copyright © CodeProject, 1999-2014
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