Maximised MDIChild bug?

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

If I set the windowstate property of my form to maximized in the designer,
when I open the form as an mdi child, it does not fill the whole of the mdi
parent form as it should. I can get around this by leaving the windowstate
as normal in the designer and changing the windowstate at runtime before the
form is displayed. Is this a known problem?
 
I have run into this issue, and that is the only way I was able to fix it as
well.
I now leave all my windows to "normal" and set teh windowstate as i create
the object by code.

If you assign icons to the mdi child forms ... I have also noticed that some
icons do not display.
I have not found a solution for this yet.

Miro
 
Hi Phil,

Could you please tell me the version of the Visual Studio you're using?

I performed tests in both VS.NET 2003 and VS 2005, but didn't reproduce the
problem in my tests.

I just set the MDI child form's WindowState property to Maximized at design
time. When the application is run, the MDI child form is shown and
maximized in its MDI parent.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
I get the same issue using Visual Studio.NET 2005 (with SP1 installed,
also got it before I installed SP1).
 
Hi Phil,

Since I couldn't reproduce the problem on my side, could you please send me
a sample project that could just reproduce the problem?

To get my actual email address, remove 'online' from my displayed email
address.

Thank you for your understanding and cooperation!

Sincerely,
Linda Liu
Microsoft Online Community Support
 
Could you please tell me the version of the Visual Studio you're using?

VB 2005 Express
I performed tests in both VS.NET 2003 and VS 2005, but didn't reproduce
the
problem in my tests.

I just set the MDI child form's WindowState property to Maximized at
design
time. When the application is run, the MDI child form is shown and
maximized in its MDI parent.

When I do this, it is sort of 'half-maximized'. The form title, and control
icons move up into the parent form, but the client area of the child form
remains the size that it was set in the designer, it does not expand to fill
the space. If I click restore then maximize, it displays correctly.
 
dermot said:
I get the same issue using Visual Studio.NET 2005 (with SP1 installed,
also got it before I installed SP1).

Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: VB Express
 
Since I couldn't reproduce the problem on my side, could you please send
me
a sample project that could just reproduce the problem?

Hmmm.
I tried creating a new project, and I am not seeing the problem, so I guess
it must be something else in my project interferring with it somehow. I'll
have a bit of a play, and see if I can find what it is that triggers it.
 
Phil said:
Hmmm.
I tried creating a new project, and I am not seeing the problem, so I
guess it must be something else in my project interferring with it
somehow. I'll have a bit of a play, and see if I can find what it is that
triggers it.
OK. I think I have found it. I only get the error when I add a MenuStrip
control to my parent form.

Here are the steps to reproduce the problem.

Create Project> Windows Application
Add> Windows Form> Windows Form
Form1 properties:
IsMDIContainer <- True
WindowState <- Maximized
Toolbox> MenuStrip -> Form1
Form 2 properties
WindowState <- Maximized
Form1.vb code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim frm As New Form2
frm.MdiParent = Me
frm.Show()
End Sub
 
Hi Phil,

Thank you for your response.

Follow your steps and I can reproduce the problem on my side.

A quick workaround is to set the MenuStrip's Visible property to false and
then back to true after the MDI child form is shown.

The following is a sample.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim frm As New Form2
frm.MdiParent = Me
frm.Show()
me.MenuStrip1.Visible = False
me.MenuStrip1.Visible = True
End Sub

I will check our inner database to see if it is a known issue in the next
Monday and then update in the newsgroup.

Thank you for reporting this to us!

Have a nice weekend!

Sincerely,
Linda Liu
Microsoft Online Community Support
 
Linda Liu said:
Hi Phil,

Thank you for your response.

Follow your steps and I can reproduce the problem on my side.

A quick workaround is to set the MenuStrip's Visible property to false and
then back to true after the MDI child form is shown.
The workaround I found is to set WindowState for the child window to Normal
in the designer, and then set this to maximized in code, when the form is
instantiated.
 
Hi Phil,

Thank you for your prompt response.

Your workaround seems to be better than mine : )

I searched in our inner database and found a similar issue in it and it is
a known issue in .NET 2.0.

It points out that this is a layout problem when the WindowState property
is set inside a Suspend/ResumeLayout block.

It also points out that a simple workaround is to set the MDI child form's
WindowState somewhere else, e.g. in the form's constructor after the
InitializeComponent call or from the form's Load event.


Sincerely,
Linda Liu
Microsoft Online Community Support
 
my child form should be inside my parent form when moved with mouse it should not come out of the parent form...hope u understand...waiting for ur reply

thanks,
narendra.G
 
Back
Top