private void button4_Click(object sender, EventArgs e) { MessageBox.Show("Resolution is going to change to " + "max" + " X " + "max"); Resolution.CResolution ChangeRes = new Resolution.CResolution(); DEVMODE1 dm1 = ChangeRes.getCurrentResolution(); DEVMODE1 dm = ChangeRes.getMaximumSupportedResolution(); List <DEVMODE1> RL = ChangeRes.getSupportedResolutionList(); for (int i = 0; i < RL.Count; i++) { Console.WriteLine("\t" + "{0} by {1}, " + "{2} bit, " + "{3} degrees, " + "{4} hertz," + "{5} color", RL[i].dmPelsWidth, RL[i].dmPelsHeight, RL[i].dmBitsPerPel, RL[i].dmDisplayOrientation * 90, RL[i].dmDisplayFrequency, RL[i].dmYResolution); } ChangeRes.setSupportedResolution(RL[RL.Count - 1]); }