Thanks Darrel for sending me the project. It really helped to understand
the problem.
The problem with the MDI Child form being a different size then you set at
design time was due to the StartupPosition property. The form's
StartupPostion was set to WindowsDefaultBounds and should have been set to
WindowsDefaultLocation.
Here's the help topic that explains the differences:
WindowsDefaultBounds The form is positioned at the Windows default location
and has the bounds determined by Windows default.
WindowsDefaultLocation The form is positioned at the Windows default
location and has the dimensions specified in the form's size.
The other problem that you mentioned with the MDIForm being the Startup
object and it causing an overflow was being caused by your call to Sub
Main() in the MDI Form_Load event. What was happening is this call was
actually calling the hidden Sub Main that was inserted in the form by the
compiler since it was the startup object so instead of calling the sub Main
in your Globals.vb file you were calling Sub Main on the form over and over
and over. To fix the problem I just following qualified the call so it
should be Globals_Rename.Main(). This fixed that problem.
--
John Hart, Microsoft VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
[quoted text, click to view] > Content-Class: urn:content-classes:message
> From: "Darrell Wesley" <anonymous@discussions.microsoft.com>
> Sender: "Darrell Wesley" <anonymous@discussions.microsoft.com>
> References: <0c5601c398a0$42724440$a401280a@phx.gbl>
<jdIBI5MmDHA.2464@cpmsftngxa06.phx.gbl>
<04b901c398e4$a8930a40$a301280a@phx.gbl>
<qTUltNZmDHA.1804@cpmsftngxa06.phx.gbl>
[quoted text, click to view] > Subject: RE: Form Size Mystery
> Date: Thu, 23 Oct 2003 14:07:45 -0700
> Lines: 203
> Message-ID: <02a701c399a9$b46b27b0$a501280a@phx.gbl>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Thread-Index: AcOZqbRrBp6NkLSqQlS+oVsrpAwSKw==
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
> Newsgroups: microsoft.public.dotnet.languages.vb.upgrade
> Path: cpmsftngxa06.phx.gbl
> Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.vb.upgrade:5658
> NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
> X-Tomcat-NG: microsoft.public.dotnet.languages.vb.upgrade
>
> The pixeltotwips conversion has been commented out and
> the .net values inserted so I don't think that is the
> cause.
>
> You keep saying "location" , this problem child form is
> not having it's location set except in the design time
> properties. I have noticed that instead of the top left
> corner of this form being in the top left corner of the
> MDI container it is offset - I even tried to set these to
> 0 and 0 and had no effect on the outcome.
>
> I will zip up the entire assembly and send it to you.
> Maybe you can see something I don't.
>
> Thanks for the help so far.
> Darrell
> >-----Original Message-----
> >I don't intially expect the compatbility library as the
> problem here. It
> >may be that the upgrade is over using the pixeltotwips
> conversion but I
> >would expect you would see that in more then just the one
> form. I didn't
> >see that you answered my question though, are you setting
> the problem Child
> >form's Location prior to it being shown?
> >
> >If you could post some code that would be helpful or you
> can send a repro
> >to me at VBResult@microsoft.com and I'll be glad to take
> a look
> >
> >--
> >John Hart, Microsoft VB Team
> >This posting is provided "AS IS" with no warranties, and
> confers no rights.
> >--------------------
> >> Content-Class: urn:content-classes:message
> >> From: "Darrell Wesley"
> <anonymous@discussions.microsoft.com>
> >> Sender: "Darrell Wesley"
> <anonymous@discussions.microsoft.com>
> >> References: <0c5601c398a0$42724440$a401280a@phx.gbl>
> ><jdIBI5MmDHA.2464@cpmsftngxa06.phx.gbl>
> >> Subject: RE: Form Size Mystery
> >> Date: Wed, 22 Oct 2003 14:37:14 -0700
> >> Lines: 113
> >> Message-ID: <04b901c398e4$a8930a40$a301280a@phx.gbl>
> >> MIME-Version: 1.0
> >> Content-Type: text/plain;
> >> charset="iso-8859-1"
> >> Content-Transfer-Encoding: 7bit
> >> X-Newsreader: Microsoft CDO for Windows 2000
> >> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
> >> Thread-Index: AcOY5KiTL4/S5fPGSX25O4XSAHDfrQ==
> >> Newsgroups: microsoft.public.dotnet.languages.vb.upgrade
> >> Path: cpmsftngxa06.phx.gbl
> >> Xref: cpmsftngxa06.phx.gbl
> >microsoft.public.dotnet.languages.vb.upgrade:5651
> >> NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
> >> X-Tomcat-NG:
> microsoft.public.dotnet.languages.vb.upgrade
> >>
> >> The problem is with one of the child forms. The only
> place
> >> where the SIZE is being set is either in the Design
> time
> >> properties or in the load event of the child form.
> >>
> >> The ControlBox property is set to TRUE for both the MDI
> >> parent and the child.
> >>
> >> The Startup form for this project is the Child form. If
> I
> >> choose to start with the MDI parent form I get sometype
> of
> >> reentrant or recursive call to the parent form
> which .net
> >> does not like but more on that later.
> >>
> >> Remember this is a VB6 program that has been run
> through
> >> the convert routine. The VB6 compatablilty layer it
> throws
> >> in may be at issue here. I know that it sets up some
> type
> >> of default instance of the form but I don't see any
> >> reference to height or width at that point.
> >>
> >> Will post sample code if needed.
> >> >-----Original Message-----
> >> >Hi Darrel,
> >> >
> >> >There was a post fairly simular to this here recently.
> >> It's not perfectly
> >> >clear to me from your post if this is the MDI form or
> the
> >> child forms that
> >> >are having the problem. Either way are you setting the
> >> location property of
> >> >these forms prior to the form load? If so try moving
> >> this to the form's
> >> >load event instead. The other example of this problem
> >> that I saw was
> >> >related to the form's location being setting prior to
> the
> >> load and the
> >> >control box property being set to False at design
> time.
> >> For some reason
> >> >this was causing the form's size calculation to be off
> >> and it appears
> >> >something simular is happening with your project.
> >> >
> >> >Let me know if this helps. If not if you could provide
> >> some a code sample
> >> >of how your showing the child form's I'll be glad to
> look
> >> into it further.
> >> >
> >> >--
> >> >John Hart, Microsoft VB Team
> >> >This posting is provided "AS IS" with no warranties,
> and
> >> confers no rights.
> >> >--------------------