Solved

How can i change my screen resolution in C# .net window application ??

Posted on 2011-02-24
2
748 Views
Last Modified: 2012-05-11
i want to change the resolution of my screen , but how can i do it ??

give me some suggestions .....
0
Comment
Question by:Parth48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
systan earned 500 total points
ID: 34969043
0
 
LVL 5

Expert Comment

by:jarrod_williams
ID: 34969132
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;

}
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Upgrade code from VS 2010 to VS 2015 7 33
how to reference the id of my checkbox in a dynamic GridView control 2 30
Coding for the first time 9 69
Selenium and Xpath 4 32
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question