Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Form stays on lefttop corner
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sergey Bogdanov  
View profile  
 More options Jan 23 2005, 5:38 am
Newsgroups: microsoft.public.dotnet.framework.compactframework
From: Sergey Bogdanov <sergey.bogda...@gmail.com>
Date: Sun, 23 Jan 2005 12:38:36 +0200
Local: Sun, Jan 23 2005 5:38 am
Subject: Re: Form stays on lefttop corner
It certainly works for WindowsCE devices but not for PocketPC due to the
fact that a window shows as fullscreen. To avoid this limitation you may
position window by yourself:

Load Event Handler
{
        Rectangle screen = Screen.PrimaryScreen.Bounds;
        this.Location = new Point((screen.Width - this.Width) / 2,
(screen.Height - this.Height ) / 2);

        //
        // below goes new code
        //

        this.Capture = true;
        IntPtr hwnd = OpenNETCF.Win32.Win32Window.GetCapture();
        this.Capture = false;

        OpenNETCF.Win32.Win32Window.SetWindowPos(hwnd,
Win32Window.SetWindowPosZOrder.HWND_TOP, this.Location.X,
this.Location.Y, this.Width, this.Height, 0);

}

Hope this help,
Sergey Bogdanov
http://www.sergeybogdanov.com
Peter wrote:
> Hello,

> My form with Borderstyle set to none and ControlBox and MaximizeBox and
> MinimizeBox set to false stays on location 0;0 (topleft)
> but I want the form centered to the screen, so I added in the formload event
> :
> Rectangle screen = Screen.PrimaryScreen.Bounds;

> this.Location = new Point((screen.Width - this.Width) / 2,

> (screen.Height - this.Height ) / 2);

> no result ! the form stays on topleft location 0;0

> Is the a solution for this problem ?

> thanks

> Peter.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.