In our application, we have functionality that does not work properly with 4k monitors. We can get things to work correctly by changing the following settings when we right click on the executable and change the compatibility settings.
My question is: Is it possible to change these two settings highlighted in the red box from within the c# code for a WPF application? I want to execute a method, change these settings, and when the timer of 5 seconds is over, I want to change them back.
Here is how I am fetching the coordinates for the screens I am identifying.
private void btn_identifyScreens_Click(object sender, RoutedEventArgs e)
{
int screenNumber = 1;
foreach (System.Windows.Forms.Screen screen in System.Windows.Forms.Screen.AllScreens)
{
NumberSplash numberSplash = new NumberSplash(screenNumber);
numberSplash.Left = screen.WorkingArea.Left;
numberSplash.Top = screen.WorkingArea.Top;
numberSplash.Width = screen.WorkingArea.Width;
numberSplash.Height = screen.WorkingArea.Height;
numberSplash.Show();
screenNumber++;
}
}