Hi,

I'm using vb.net to develop a pocket pc application. I would like to depend
on the screen orientation to change the application look and view. I have try
the following link but it seems that i cant get the systemsettings from the
lib, what lib should i import? or what should i add in order to get the
orientation object?

http://msdn2.microsoft.com/en-us/library/microsoft.windowsce.forms.screenorientation.aspx

Thanks!!

Re: Screen orientation by ---

---
Thu Apr 27 22:19:08 CDT 2006

On Thu, 27 Apr 2006 18:48:01 -0700, =?Utf-8?B?QW15?=
<Amy@discussions.microsoft.com> wrote:

>Hi,
>
>I'm using vb.net to develop a pocket pc application. I would like to depend
>on the screen orientation to change the application look and view. I have try
>the following link but it seems that i cant get the systemsettings from the
>lib, what lib should i import? or what should i add in order to get the
>orientation object?

Just do this:

int cxscreen = GetSystemMetrics(SM_CXSCREEN);
int cyscreen = GetSystemMetrics(SM_CYSCREEN);

If cxscreen > cyscreen, then you are in landscape mode. Otherwise you are in
portrait mode. If you check this in response to a WM_SIZE message, then you
will know when the user has changed the screen orientation after your program
has started.


Robert Scott
Ypsilanti, Michigan

Re: Screen orientation by ctacke/>

ctacke/>
Fri Apr 28 07:31:32 CDT 2006

Be aware that some devices have square screens....

-Chris


"Robert Scott" <---@---> wrote in message
news:4451893a.420625@news.provide.net...
> On Thu, 27 Apr 2006 18:48:01 -0700, =?Utf-8?B?QW15?=
> <Amy@discussions.microsoft.com> wrote:
>
>>Hi,
>>
>>I'm using vb.net to develop a pocket pc application. I would like to
>>depend
>>on the screen orientation to change the application look and view. I have
>>try
>>the following link but it seems that i cant get the systemsettings from
>>the
>>lib, what lib should i import? or what should i add in order to get the
>>orientation object?
>
> Just do this:
>
> int cxscreen = GetSystemMetrics(SM_CXSCREEN);
> int cyscreen = GetSystemMetrics(SM_CYSCREEN);
>
> If cxscreen > cyscreen, then you are in landscape mode. Otherwise you
> are in
> portrait mode. If you check this in response to a WM_SIZE message, then
> you
> will know when the user has changed the screen orientation after your
> program
> has started.
>
>
> Robert Scott
> Ypsilanti, Michigan



Re: Screen orientation by r_z_aret

r_z_aret
Fri Apr 28 16:57:32 CDT 2006

On Fri, 28 Apr 2006 03:19:34 GMT, ---@--- (Robert Scott) wrote:

>On Thu, 27 Apr 2006 18:48:01 -0700, =?Utf-8?B?QW15?=
><Amy@discussions.microsoft.com> wrote:
>
>>Hi,
>>
>>I'm using vb.net to develop a pocket pc application. I would like to depend
>>on the screen orientation to change the application look and view. I have try
>>the following link but it seems that i cant get the systemsettings from the
>>lib, what lib should i import? or what should i add in order to get the
>>orientation object?
>
>Just do this:
>
> int cxscreen = GetSystemMetrics(SM_CXSCREEN);
> int cyscreen = GetSystemMetrics(SM_CYSCREEN);
>
>If cxscreen > cyscreen, then you are in landscape mode. Otherwise you are in
>portrait mode. If you check this in response to a WM_SIZE message, then you
>will know when the user has changed the screen orientation after your program
>has started.

This approach means choosing among a set of pre-determined screens. I
favor drawing each screen dynamically in response to WM_SIZE messages.
I use the dimensions given by GetSystemMetrics to size and place all
the controls. This way I cover unexpected screens like the square ones
Chris Tacke mentioned, and some odd shapes I've encountered on
industrial handhelds.

I've also found I need to update the window in response to a
WM_SETTINGCHANGE message sent with SETTINGCHANGE_RESET parameter. See
the 22 Dec 05 contribution by mmobile to a thread called "Portrait to
Landscape..." in microsoft.public.pocketpc.developer

>
>
>Robert Scott
>Ypsilanti, Michigan

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

Re: Screen orientation by Amy

Amy
Fri Apr 28 21:37:01 CDT 2006

Thanks for all of your reply.

I have found the following way to change the screen orientation

http://msdn2.microsoft.com/en-us/library/microsoft.windowsce.forms.systemsettings.screenorientation.aspx

but remember to add the reference in the project in order to use the
screenorientation object. ^^

"r_z_aret@pen_fact.com" wrote:

> On Fri, 28 Apr 2006 03:19:34 GMT, ---@--- (Robert Scott) wrote:
>
> >On Thu, 27 Apr 2006 18:48:01 -0700, =?Utf-8?B?QW15?=
> ><Amy@discussions.microsoft.com> wrote:
> >
> >>Hi,
> >>
> >>I'm using vb.net to develop a pocket pc application. I would like to depend
> >>on the screen orientation to change the application look and view. I have try
> >>the following link but it seems that i cant get the systemsettings from the
> >>lib, what lib should i import? or what should i add in order to get the
> >>orientation object?
> >
> >Just do this:
> >
> > int cxscreen = GetSystemMetrics(SM_CXSCREEN);
> > int cyscreen = GetSystemMetrics(SM_CYSCREEN);
> >
> >If cxscreen > cyscreen, then you are in landscape mode. Otherwise you are in
> >portrait mode. If you check this in response to a WM_SIZE message, then you
> >will know when the user has changed the screen orientation after your program
> >has started.
>
> This approach means choosing among a set of pre-determined screens. I
> favor drawing each screen dynamically in response to WM_SIZE messages.
> I use the dimensions given by GetSystemMetrics to size and place all
> the controls. This way I cover unexpected screens like the square ones
> Chris Tacke mentioned, and some odd shapes I've encountered on
> industrial handhelds.
>
> I've also found I need to update the window in response to a
> WM_SETTINGCHANGE message sent with SETTINGCHANGE_RESET parameter. See
> the 22 Dec 05 contribution by mmobile to a thread called "Portrait to
> Landscape..." in microsoft.public.pocketpc.developer
>
> >
> >
> >Robert Scott
> >Ypsilanti, Michigan
>
> -----------------------------------------
> To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>
> Robert E. Zaret, eMVP
> PenFact, Inc.
> 20 Park Plaza, Suite 478
> Boston, MA 02116
> www.penfact.com
>