MDIParent and MaximizedBounds bug(?)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Howdy!

I'm trying to build an MDI application.
I've added a 'toolbox' navigation control down the left inside of the parent
form.
Now I need to change the child forms so they do not hide behind the toolbox
when maximized.
I am trying to use .MaximizedBounds but its bugged. =(
Do any of my fantastic peers have any suggestions?


To better understand the issue, do me a favor and try the following:

STEP 1: Make a new project

STEP 2: Add Form1 and Form2

STEP 3: Add this code to Form1:
Private Sub Form1_Load()
Me.IsMdiConatiner = True
Dim Child1 as new Form2
Child1.Visible = True
Dim Child2 as New Form2
Child2.MIDParent = Me
Child2.Visible = True
End Sub

STEP 4: Add this code to Form2:
Private Sub Form2_Load()
Me.MaximizedBounds = New System.Drawing.Rectangle (25, 25, 200, 200)
End Sub

STEP 5: Run it

Notice how Child1 will comply with the MaximizedBounds setting.
Notice how Child2 ignores the MaximizedBounds setting.
 
imnotamib said:
Howdy!

I'm trying to build an MDI application.
I've added a 'toolbox' navigation control down the left inside of
the parent form.
Now I need to change the child forms so they do not hide behind the
toolbox when maximized.
I am trying to use .MaximizedBounds but its bugged. =(
Do any of my fantastic peers have any suggestions?


To better understand the issue, do me a favor and try the following:

STEP 1: Make a new project

STEP 2: Add Form1 and Form2

STEP 3: Add this code to Form1:
Private Sub Form1_Load()
Me.IsMdiConatiner = True
Dim Child1 as new Form2
Child1.Visible = True
Dim Child2 as New Form2
Child2.MIDParent = Me
Child2.Visible = True
End Sub

STEP 4: Add this code to Form2:
Private Sub Form2_Load()
Me.MaximizedBounds = New System.Drawing.Rectangle (25, 25, 200, 200)
End Sub

STEP 5: Run it

Notice how Child1 will comply with the MaximizedBounds setting.
Notice how Child2 ignores the MaximizedBounds setting.



Right, because it's an MDI child. It's maximized to the size of the
MDIContainer.


Armin
 
Armin Zingler said:
Right, because it's an MDI child. It's maximized to the size of the
MDIContainer.


I forgot to say:

If you dock your navigation control within the MDI parent, the child is not
hidden behind the control, even if it is maximized.


Armin
 
Back
Top