Re: centering a form

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jezebel (dwarves_at_heaven.com.kr)
Date: 07/11/04


Date: Sun, 11 Jul 2004 16:34:01 +1000

This method might be better from a performance point of view, but it's using
the same co-ordinates, so the end result will surely be the same? And if the
original doesn't actually put the form in the middle ....?

"Randy Birch" <rgb_removethis@mvps.org> wrote in message
news:efkuuUvZEHA.3480@TK2MSFTNGP11.phx.gbl...
> Use the Move method, not the left and top properties ...
>
> http://vbnet.mvps.org/code/faq/centreform.htm
> http://vbnet.mvps.org/code/faq/centreparent.htm
>
>
> --
>
> Randy Birch
> MVP Visual Basic
> http://vbnet.mvps.org/
> Please respond only to the newsgroups so all can benefit.
>
>
> "Scott Baxter" <sbaxter@websearchstore.com> wrote in message
> news:#9WRDcuZEHA.3228@TK2MSFTNGP12.phx.gbl...
> : I have been trying to center a form on Windows 2000 using the following
> : subroutine:
> :
> : Public Sub center(Anyform As Form)
> : Anyform.left = (Screen.Width - Anyform.Width) / 2
> : Anyform.tOp = (Screen.Height - Anyform.Height) / 2
> : DoEvents
> : End Sub
> :
> : However, the form ends up on the lower right of the computer when
> : autostarted during windows startup.
> :
> : If I run it in development mode, it works perfectly.
> :
> : In startup mode the screen.height and width seem totally wrong.
> :
> : What is the answer? Any help would be great.
> :
> : Scott Baxter
> :
> :
>



Relevant Pages

  • Re: centering a form
    ... "Scott Baxter" wrote in message ... Public Sub center ... the form ends up on the lower right of the computer when: autostarted during windows startup. ... If I run it in development mode, ...
    (microsoft.public.vb.general.discussion)
  • Re: centering a form
    ... the same co-ordinates, so the end result will surely be the same? ... Public Sub center ... >: autostarted during windows startup. ... If I run it in development mode, ...
    (microsoft.public.vb.general.discussion)
  • Re: centering a form
    ... "Scott Baxter" wrote in message ... Public Sub center ... the form ends up on the lower right of the computer when: autostarted during windows startup. ... If I run it in development mode, ...
    (microsoft.public.vb.6.webdevelopment)
  • Re: centering a form
    ... >Public Sub center ... >autostarted during windows startup. ... >If I run it in development mode, ... I would make a minute test App to confirm that this is really the ...
    (microsoft.public.vb.general.discussion)
  • Re: centering a form
    ... French) wrote: ... >>autostarted during windows startup. ... >>If I run it in development mode, ... Whoops - forget that about ScaleMode - a brain fart ...
    (microsoft.public.vb.general.discussion)