PDA

View Full Version : سوال: screen resolution



SHM313
دوشنبه 23 آذر 1388, 18:27 عصر
سلام دوستان؛
چطوری میشه screen resolution ویندوز رو در ابتدای برنامه عوض کرد؟:لبخندساده:

fjm11100
سه شنبه 24 آذر 1388, 08:39 صبح
Screen Srn = Screen.PrimaryScreen;
tempHeight = Srn.Bounds.Width;
tempWidth = Srn.Bounds.Height;
Page.ClientScript.RegisterStartupScript(this.GetTy pe(), "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;
}

SHM313
سه شنبه 24 آذر 1388, 16:54 عصر
با تشکر از fjm11100
اما اگه ممکنه درباره کلاس ها و namespace های استفاده شده توضیح بدید.:لبخند:
ممنون؛

fjm11100
پنج شنبه 26 آذر 1388, 09:16 صبح
كلاس screen توي System.Windows.Forms است