S
Saurabh
Hi,
Can anyone please tell me any other way(s) to change the screen orientation.
Currently, What I did is:
1) Develop the UI based on a particular screen orientation ( portrait -
240X320).
2) In the resize event of every page, I found the ratio of height for the
current clientrectangle height to 320 and similar ratio for width.
i.e heightratio = this.clientrectangle.height/288 ( and not 320 because 320
is overall width and 288 is the client rectangle width that is there in my
app.)
widthratio = this.clientrectangle.width /240
3) I multiplied the bounds of each control with the height and width ratio
as in :
label1.bounds = new size((int)Math.Round(WidthRatio * x),
(int)Math.Round(HeightRatio * y))
With this, the orientation is changing but there is a lot of overlap between
the controls because of approximate results. Also, this approach is generic
i.e. independent of any resolution and orientation. Is there any better way
out?
Secondly, When we resize any form, then all the forms which are cached also
get resized. This causes a lot of overhead. Can we stop that.
Please help
Saurabh
Can anyone please tell me any other way(s) to change the screen orientation.
Currently, What I did is:
1) Develop the UI based on a particular screen orientation ( portrait -
240X320).
2) In the resize event of every page, I found the ratio of height for the
current clientrectangle height to 320 and similar ratio for width.
i.e heightratio = this.clientrectangle.height/288 ( and not 320 because 320
is overall width and 288 is the client rectangle width that is there in my
app.)
widthratio = this.clientrectangle.width /240
3) I multiplied the bounds of each control with the height and width ratio
as in :
label1.bounds = new size((int)Math.Round(WidthRatio * x),
(int)Math.Round(HeightRatio * y))
With this, the orientation is changing but there is a lot of overlap between
the controls because of approximate results. Also, this approach is generic
i.e. independent of any resolution and orientation. Is there any better way
out?
Secondly, When we resize any form, then all the forms which are cached also
get resized. This causes a lot of overhead. Can we stop that.
Please help
Saurabh