Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating projects for different screen resolutions 1

Status
Not open for further replies.

michelleHEC

Programmer
Oct 20, 2003
95
US
I design my projects while using 1280 x 1024 but my users have their settings at 800 x 600. This causes a problem with the usability of the program. They are having to scroll everywhere. Is there a way to avoid this?
Michelle
 
See the Scale Method.
private void ScaleMe()
{
SizeF factors;
factors = JYResizer.Scale(this, new Size(800, 600));
}
internal static SizeF Scale(Form frm,
Size designSize)
{
Rectangle rec = Screen.GetWorkingArea(frm);
float xFactor, yFactor;
xFactor = Convert.ToSingle(rec.Width / designSize.Width);
yFactor = Convert.ToSingle(rec.Height / designSize.Height);
if (xFactor < yFactor) yFactor = xFactor;
if (xFactor != 1 || yFactor != 1) frm.Scale(xFactor, yFactor);
return new SizeF(xFactor, yFactor);
}


Compare Code
 
The code you have shown isn't vb.net. do you know how to do it in visual basic.net?
thank you
 
private sub ScaleMe()
{
dim factors as SizeF
factors = JYResizer.Scale(me, new Size(800, 600))
}
Friend Shared Scale(frm as Form,
designSize as Size) as SizeF

Dim rec as Rectangle = Screen.GetWorkingArea(frm)
Dim xFactor, yFactor as Double
xFactor = Convert.ToSingle(rec.Width / designSize.Width)
yFactor = Convert.ToSingle(rec.Height / designSize.Height)
if (xFactor < yFactor) then yFactor = xFactor
if (xFactor <> 1 orelse yFactor <> 1) then
frm.Scale(xFactor, yFactor)
return new SizeF(xFactor, yFactor)



Compare Code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top