E
Ed Hochberg
Hi all, I found the following code on the web. It says it is for C#. Problem
is that it seems to be for ASP (it uses the Page_Load procedure) and I need
it for a regular Windows form. can anyone suggest how it may be modified for
my needs.
Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page_Load Code
Screen Srn = Screen.PrimaryScreen;
tempHeight = Srn.Bounds.Width;
tempWidth = Srn.Bounds.Height;
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script
type=\"text/javascript\">alert('" + "Your Current Resolution is = " +
tempHeight + " * " + tempWidth + "');</script>");
//if you want Automatically Change res.at page load. please uncomment this
code.
if (tempHeight == 600)//if the system is 800*600 Res.then change to
{
FixHeight = 768;
FixWidth = 1024;
Resolution.CResolution ChangeRes = new Resolution.CResolution(FixHeight,
FixWidth);
}
Change Resoultion
switch (cboRes.SelectedValue.ToString())
{
case "800*600":
FixHeight = 800;
FixWidth = 600;
Resolution.CResolution ChangeRes600 = new
Resolution.CResolution(FixHeight, FixWidth);
break;
case "1024*768":
FixHeight = 1024;
FixWidth = 768;
Resolution.CResolution ChangeRes768 = new
Resolution.CResolution(FixHeight, FixWidth);
break;
case "1280*1024":
FixHeight = 1280;
FixWidth = 1024;
Resolution.CResolution ChangeRes1024 = new
Resolution.CResolution(FixHeight, FixWidth);
break;
}
is that it seems to be for ASP (it uses the Page_Load procedure) and I need
it for a regular Windows form. can anyone suggest how it may be modified for
my needs.
Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page_Load Code
Screen Srn = Screen.PrimaryScreen;
tempHeight = Srn.Bounds.Width;
tempWidth = Srn.Bounds.Height;
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script
type=\"text/javascript\">alert('" + "Your Current Resolution is = " +
tempHeight + " * " + tempWidth + "');</script>");
//if you want Automatically Change res.at page load. please uncomment this
code.
if (tempHeight == 600)//if the system is 800*600 Res.then change to
{
FixHeight = 768;
FixWidth = 1024;
Resolution.CResolution ChangeRes = new Resolution.CResolution(FixHeight,
FixWidth);
}
Change Resoultion
switch (cboRes.SelectedValue.ToString())
{
case "800*600":
FixHeight = 800;
FixWidth = 600;
Resolution.CResolution ChangeRes600 = new
Resolution.CResolution(FixHeight, FixWidth);
break;
case "1024*768":
FixHeight = 1024;
FixWidth = 768;
Resolution.CResolution ChangeRes768 = new
Resolution.CResolution(FixHeight, FixWidth);
break;
case "1280*1024":
FixHeight = 1280;
FixWidth = 1024;
Resolution.CResolution ChangeRes1024 = new
Resolution.CResolution(FixHeight, FixWidth);
break;
}