|
-
Nov 12th, 2007, 05:41 AM
#1
Thread Starter
Hyperactive Member
[2005] Maximising Problem
If have more than one childform in the Parent form, and i maximize one child form then the remaining child forms also gets maximized automatically. How can i prevent this to happen ?
-
Nov 12th, 2007, 05:49 AM
#2
Frenzied Member
Re: [2005] Maximising Problem
Put this into the Form's Activated event handler:
Code:
Me.WindowState = FormWindowState.Normal
-
Nov 12th, 2007, 07:30 AM
#3
Re: [2005] Maximising Problem
That's how MDI works. That's how it's supposed to work and that's how it always works. If one child is maximised then they all are. If one isn't then none of them are.
-
Nov 12th, 2007, 07:40 AM
#4
Thread Starter
Hyperactive Member
Re: [2005] Maximising Problem
JMC, Is there anyway this can be avoided ?
-
Nov 12th, 2007, 07:42 AM
#5
Frenzied Member
Re: [2005] Maximising Problem
I recently had the opposite problem - the first MDI child was in its normal window state despite its "WindowState" property being set to "Maximized" at design time. Subsequent MDI forms are maximised even if the "WindowState" property is set to "Normal" at design time.
To alter this behaviour, the "WindowState" property of the MDI child must be set at runtime in either the form's load or activated event procedure depending on which outcome you are trying to achieve.
-
Nov 12th, 2007, 09:44 AM
#6
Thread Starter
Hyperactive Member
Re: [2005] Maximising Problem
i have set the windowstate property of my mdi child to normal in the load event. But still i'm facing this problem.
-
Nov 12th, 2007, 09:58 AM
#7
Frenzied Member
Re: [2005] Maximising Problem
 Originally Posted by robertx
Put this into the Form's Activated event handler:
Code:
Me.WindowState = FormWindowState.Normal
It needs to go into the MDI Child Form's Activated event handler - see Post #2 above.
To always make the MDI child's window state normal:
Code:
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Me.WindowState = FormWindowState.Normal
End Sub
To always make the MDI child's window state maximised:
Code:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
End Sub
-
Nov 12th, 2007, 11:07 AM
#8
Re: [2005] Maximising Problem
could always use the Resize event with this code:
If Me.WindowState = WindowState.Maximized Then Me.WindowState = WindowState.Normal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|