| Subject: Determine Tablet PC screen mode |
| Group: microsoft.public.windows.tabletpc |
| Date: 7/30/2008 11:37:03 AM |
| From: Carl Ganz [Email Address Protection] |
I'm developing a VB.NET 2005 WinForms application that will run on a tablet PC. I want to build a screen resizer method that will position the forms and controls properly depending on whether the display is in landscape mode (using the tablet like a notebook with keyboard) or portrait mode (using the tablet, well, as a tablet). I can trap when the user flips the display via the SystemEvents.DisplaySettingsChanged event. The problem is I can't determine the difference between portrait and landscape modes. The PrimaryScreen.WorkingArea.Width and PrimaryScreen.WorkingArea.Height both return the same values regardless of how the display is set. How do I determine which mode I'm in so I can resize things accordingly? Thanks Carl |
| Back |
| Subject: Re: Determine Tablet PC screen mode |
| Group: microsoft.public.windows.tabletpc |
| Date: 7/30/2008 12:16:04 PM |
| From: "Beverly Howard [Ms-MVP/MobileDev]" [Email Address Protection] |
>> I want to build a screen resizer method that will position the forms and controls properly depending on whether the display is in landscape mode (using the tablet like a notebook with keyboard) or portrait mode (using the tablet, well, as a tablet). << Wow... I like your programming approach ;-) Don't have the answer, but, you might try dumping the registry, change the orientation, then dump again to a different file and run a file compare. Beverly Howard [MS MVP-Mobile Devices] |
| Back |
| Subject: Re: Determine Tablet PC screen mode |
| Group: microsoft.public.windows.tabletpc |
| Date: 7/30/2008 12:37:07 PM |
| From: SetonSoftware [Email Address Protection] |
On Jul 30, 3:16=A0pm, "Beverly Howard [Ms-MVP/MobileDev]" <BevNoSpamBevHoward.com> wrote: > =A0>> I want to build a screen resizer method that will position > the forms and controls properly depending on whether the display is in > landscape mode (using the tablet like a notebook with keyboard) or > portrait mode (using the tablet, well, as a tablet). << > > Wow... I like your programming approach ;-) > > Don't have the answer, but, you might try dumping the registry, change > the orientation, then dump again to a different file and run a file compa= re. > > Beverly Howard [MS MVP-Mobile Devices] Is this information stored in the registry? I was expecting some type of environmental variable. Also, I'm not sure from your answer if there is something fundamentally wrong with my programming approach. if so, please tell me. Thanks Carl |
| Back |
| Subject: Re: Determine Tablet PC screen mode |
| Group: microsoft.public.windows.tabletpc |
| Date: 7/30/2008 1:00:25 PM |
| From: SetonSoftware [Email Address Protection] |
On Jul 30, 3:37=A0pm, SetonSoftware <seton.softw...@verizon.net> wrote: > On Jul 30, 3:16=A0pm, "Beverly Howard [Ms-MVP/MobileDev]" > > <BevNoSpamBevHoward.com> wrote: > > =A0>> I want to build a screen resizer method that will position > > the forms and controls properly depending on whether the display is in > > landscape mode (using the tablet like a notebook with keyboard) or > > portrait mode (using the tablet, well, as a tablet). << > > > Wow... I like your programming approach ;-) > > > Don't have the answer, but, you might try dumping the registry, change > > the orientation, then dump again to a different file and run a file com= pare. > > > Beverly Howard [MS MVP-Mobile Devices] > > Is this information stored in the registry? I was expecting some type > of environmental variable. > > Also, I'm not sure from your answer if there is something > fundamentally wrong with my programming approach. if so, please tell > me. > > Thanks > > Carl OK, I posted before doing sufficient research. Here is the solution: http://msdn.microsoft.com/en-us/library/ms812142.aspx |
| Back |
| Subject: Re: Determine Tablet PC screen mode |
| Group: microsoft.public.windows.tabletpc |
| Date: 7/30/2008 1:27:17 PM |
| From: "Rainald Taesler" [Email Address Protection] |
Carl, in addition to the other replies: There's a special NewsGroup dedicated to developing for TabletPCs tabletpc.developermicrodift.public.windows.tabletpc.developer Rainald Carl Ganz schrieb: > I'm developing a VB.NET 2005 WinForms application that will run on a > tablet PC. I want to build a screen resizer method that will > position the forms and controls properly depending on whether the > display is in landscape mode (using the tablet like a notebook with > keyboard) or portrait mode (using the tablet, well, as a tablet). I > can trap when the user flips the display via the > SystemEvents.DisplaySettingsChanged event. The problem is I can't > determine the difference between portrait and landscape modes. The > PrimaryScreen.WorkingArea.Width and > PrimaryScreen.WorkingArea.Height both return the same values > regardless of how the display is set. > > How do I determine which mode I'm in so I can resize things > accordingly? > > Thanks > > Carl |
| Back |
| Subject: Re: Determine Tablet PC screen mode |
| Group: microsoft.public.windows.tabletpc |
| Date: 7/31/2008 7:59:18 AM |
| From: "Beverly Howard [Ms-MVP/MobileDev]" [Email Address Protection] |
Your programming approach is both great and _rare_ ...i.e. you program for the user rather than yourself... kudos! Beverly Howard [MS MVP-Mobile Devices] |
| Back |
| Subject: Re: Determine Tablet PC screen mode |
| Group: microsoft.public.windows.tabletpc |
| Date: 7/31/2008 8:03:14 AM |
| From: "Beverly Howard [Ms-MVP/MobileDev]" [Email Address Protection] |
>> Is this information stored in the registry? << I would assume it's in the registry, but, don't know... for example, if the user reboots, so it can come back up in the same mode. Faced with similar needs in the past, the approach of closing everything I could, then dumping the registry, then making a change, then dumping the registry again to a second file for a file compare would often, with a little searching, turn up the related registry key and the entries for the two states. Beverly Howard [MS MVP-Mobile Devices] |
| Back |