private void button1_Click(object sender, EventArgs e) { DisplayOrientation ori = ScreenSetting.GetScreenOrientation(); if (ori == DisplayOrientation.DmdoDEFAULT) { ori = DisplayOrientation.Dmdo90; } else { ori = DisplayOrientation.DmdoDEFAULT; } ScreenSetting.Orientation(ori); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DisplayOrientation ori = ScreenSetting.GetScreenOrientation(); if (ori == DisplayOrientation.DmdoDEFAULT) { ori = DisplayOrientation.Dmdo90; } else { ori = DisplayOrientation.DmdoDEFAULT; } ScreenSetting.Orientation(ori); //Application.Run(new Form1()); }