PDA

View Full Version : Screen size detection


martinbarrett
12-09-2008, 04:09 AM
Hi

I have created a project suitable for 1280 x 1024 resolution. It is being reviewed and I've been asked if it can be viewed at a smaller screen size.

Is there something that can be done in the software to auto detect the users screen size?

I hope someone can help
Martin

longedge
12-09-2008, 05:37 AM
Yes-

tbl_display = System.GetDisplayInfo();
width=tbl_display.Width;
height=tbl_display.Height;

Search the forum for "re-size" you'll find loads of stuff

martinbarrett
12-09-2008, 06:29 AM
Thanks, where do I put the code, and will this resize my project to the users screen size?

Cheers
Martin

longedge
12-09-2008, 06:51 AM
The code is in answer to your question "Is there something that can be done in the software to auto detect the users screen size" it doesn't do anything about re-sizing the application but as I said, if you search the forum you'll find loads of stuff and some examples as well.

Personally I always put this in the application startup, but it will work anywhere.

martinbarrett
12-09-2008, 08:42 AM
Thanks again. I've found a resize example and I can set my pages to resize and the objects within scale with it. Which is great.

I pasted the code you supplied in the on -startup actions and it doesn't do anything. Is this correct?:huh

Martin

Imagine Programming
12-09-2008, 09:35 AM
It only stores the user's Screen width and height in the variables width and hight.

holtgrewe
12-09-2008, 01:12 PM
The code below, on startup, should give you the proper screen size.
However keep in mind, as you resize your page, all objects on the page may also need resizing. It can be somewhat daunting if you didn't allow for this at design time...

WndHandle=Application.GetWndHandle()
SysInfo = System.GetDisplayInfo()
Window.SetPos(WndHandle, 0, 0)
Window.SetSize(WndHandle, SysInfo.Width, SysInfo.Height)

hth

Centauri Soldier
12-13-2008, 10:32 PM
--Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].
while 1==1 do
Dialog.Message("Oh", "oooh....");
end

OMG LMAO! I can't stop laughing...

Imagine Programming
12-13-2008, 11:02 PM
OMG LMAO! I can't stop laughing...

hehe never heard that one before have yah?:P