Get Screen size

  • Thread starter Thread starter Kenny Rymes
  • Start date Start date
K

Kenny Rymes

Hello

I'm using .NET CF 1, and I want to know if the screen size is 320x240 or
640x480

If I use me.width then it's always 240 even if the real resolutaion is
480.....

Kenny
 
Peter said:
You can retrieve the screen size using
System.Windows.Forms.Screen.PrimaryScreen.Bounds

If you have a hi-dpi device it will return legacy 240x320 resolution
using the compatibility layer unless your exe is marked as hi-dpi
aware by using an embedded resource. You can use the Res2Exe tool in
this download:-
http://www.microsoft.com/downloads/...83-C3CE-4A4C-AB83-491FD5729551&displaylang=en

Peter

This raises a question ....that download appears to be for VS2003, is it
still current for VS 2005? I am often confused about downloads like this,
wondering whether the web page just needs updating (i.e. no reference
to VS 2005).

--
Cheers.......


Will Chapman
nb Quidditch
 
From my testing it is still necessary to perform this process on a .NETCF
v1.0 app created with VS2005. A .NETCF v2.0 project will have this resource
added to it (and .NETCF v2.0's docking/anchoring support makes it easier to
cater for size differences).

Peter
 
Back
Top