PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework How to tell if screen is portrait or landscape.

Reply

How to tell if screen is portrait or landscape.

 
Thread Tools Rate Thread
Old 07-03-2006, 07:50 PM   #1
=?Utf-8?B?Um9i?=
Guest
 
Posts: n/a
Default How to tell if screen is portrait or landscape.


I am trying to determine if the user is looking at the pda/phone in portrait
or landscape. I found references to using GetSystemMetrics but I cannot see
how to add a reference that would enable me to use it. Does anyone have VB
code to determine the layout?

Thanks

Robert
  Reply With Quote
Old 07-03-2006, 07:55 PM   #2
Chris Tacke, MVP
Guest
 
Posts: n/a
Default Re: How to tell if screen is portrait or landscape.

Just check the Screen.PrimaryScreen.WorkingArea's width and height.

-Chris


"Rob" <Rob@discussions.microsoft.com> wrote in message
news:6570C7D9-855D-436F-8122-BB8CA3E24AF1@microsoft.com...
>I am trying to determine if the user is looking at the pda/phone in
>portrait
> or landscape. I found references to using GetSystemMetrics but I cannot
> see
> how to add a reference that would enable me to use it. Does anyone have
> VB
> code to determine the layout?
>
> Thanks
>
> Robert



  Reply With Quote
Old 07-03-2006, 08:16 PM   #3
=?Utf-8?B?Um9i?=
Guest
 
Posts: n/a
Default Re: How to tell if screen is portrait or landscape.

Thank you!

"Chris Tacke, MVP" wrote:

> Just check the Screen.PrimaryScreen.WorkingArea's width and height.
>
> -Chris
>
>
> "Rob" <Rob@discussions.microsoft.com> wrote in message
> news:6570C7D9-855D-436F-8122-BB8CA3E24AF1@microsoft.com...
> >I am trying to determine if the user is looking at the pda/phone in
> >portrait
> > or landscape. I found references to using GetSystemMetrics but I cannot
> > see
> > how to add a reference that would enable me to use it. Does anyone have
> > VB
> > code to determine the layout?
> >
> > Thanks
> >
> > Robert

>
>
>

  Reply With Quote
Old 10-03-2006, 12:41 AM   #4
Robert Levy [MS]
Guest
 
Posts: n/a
Default Re: How to tell if screen is portrait or landscape.

Use Bounds instead of WorkingArea.

Otherwise, you'll end up treating square-screen devices like the Treo as
Landscape instead of Portrait since WorkingArea subtracts out shell stuff
like the title bar and menu bar.

--
-Robert Levy
Program Manager, Consumer Productivity Experiences


"Chris Tacke, MVP" <ctacke@spamfree-opennetcf.org> wrote in message
news:%23Os$vEiQGHA.3804@TK2MSFTNGP15.phx.gbl...
> Just check the Screen.PrimaryScreen.WorkingArea's width and height.
>
> -Chris
>
>
> "Rob" <Rob@discussions.microsoft.com> wrote in message
> news:6570C7D9-855D-436F-8122-BB8CA3E24AF1@microsoft.com...
>>I am trying to determine if the user is looking at the pda/phone in
>>portrait
>> or landscape. I found references to using GetSystemMetrics but I cannot
>> see
>> how to add a reference that would enable me to use it. Does anyone have
>> VB
>> code to determine the layout?
>>
>> Thanks
>>
>> Robert

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off