Make form adapt to screen size

A

abelikoff

Hello - what is the most appropriate way to make sure a form is
automatically resized to fit the screen as opposed to using pre-
defined size? I have an app which is simple enough to make it into
several projects: one for Windows Mobile 5.0 smartphone form factor,
another for Windows Mobile 6.0 Standard just to cater to different
screen sizes. I'd much rather make the form take whatever screen size
is available.

And another question on .NET CF 1.0: what is the most appropriate way
to add a menu to the left soft key (VS.NET doesn't seem to like it)?

Thanks.
-- Alexander
 
S

Simon Hart [MVP]

You've not said whether you are developing on CF 2.0, I know you mentioned CF
1.0 but this is not clear. If using CF 2.0 then the normal practice is to use
Anchoring and docking support at a basic level. If you want more advanced
functionality then the orientation aware control (part of MCSF Mobile Client
Software Factory) might help.

Adding menu's whatever versin of VS/framework is the same. To use the soft
menu buttons, you need to create a maximum of two top level menu items. The
OS will then render these into soft keys at runtime (on WM5 and later).

cheers,
 
A

abelikoff

I'm sorry if I was unclear, but I meant resizing of the *form* itself,
not the controls within (I am aware of controls resizing and anchoring
- it is fairly well documented). I just want to make sure that the
form itself occupies the entire screen on any form factor. Currently,
I'm running a program designed for WM 5.0 Smartphone (.NET CF 2.0) on
a WM 6.1 Standard smartphone and the form ends up sporting a vertical
scrollbar (this is a simple About dialog form without any
sophisticated logic). Or could it be a DPI issue?

Regards,
-- Alexander
 
S

Simon Hart [MVP]

I don't understand your question. You don't need to worry about sizing of the
form on WM devices, the form will always occupy the entire client area.
Setting of the AutoScaleMode will determine whether hi-res support is
supported or not.

I always set AutoScroll to false. Ensure you do not have any controls
outside of the viewable client area.
 
A

abelikoff

Simon - you are absolutely correct. I've actually managed to figure
this out last night, by disabling the AutoScroll feature and anchoring
the controls. All the issues went away.

Thanks again for the clarification,
-- Alexander
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top