How To Change The Screen Resolution in C#
Posted
by
SAMIR BHOGAYTA
on Samir ASP.NET with C# Technology
See other posts from Samir ASP.NET with C# Technology
or by SAMIR BHOGAYTA
Published on 2010-11-18T23:21:00.001-08:00
Indexed on
2010/12/06
17:00 UTC
Read the original article
Hit count: 627
How To Change The Screen
Page_Load Function
Screen Srn = Screen.PrimaryScreen;
tempHeight = Srn.Bounds.Width;
tempWidth = Srn.Bounds.Height;
Page.ClientScript.RegisterStartupScript
(this.GetType(), "Error", "");
//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 in C# 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":How To Change The Screen Resolution in C#
FixHeight = 1280;
FixWidth = 1024;
Resolution.CResolution ChangeRes1024 =
new Resolution.CResolution(FixHeight, FixWidth);
break;
}
© Samir ASP.NET with C# Technology or respective owner