public DisplayLayoutWindow(MainWindow obj) { InitializeComponent(); mainWindow = obj; if ((int)SaveData.config.WallpaperArrangement >= 0 && (int)SaveData.config.WallpaperArrangement <= 1) { displayLayoutSelect.SelectedIndex = (int)SaveData.config.WallpaperArrangement; } else { SaveData.config.WallpaperArrangement = 0; SaveData.SaveConfig(); displayLayoutSelect.SelectedIndex = 0; } displayLayoutSelect.SelectionChanged += ComboBox_SelectionChanged; DisplayLB.ItemsSource = displayLBItems; UpdateDisplayListBox(); //screen identification foreach (var item in System.Windows.Forms.Screen.AllScreens) { DisplayID id = new DisplayID(item.DeviceName, item.Bounds.X, item.Bounds.Y) { //does not work properly in different dpi situations, using setwindowpos instead. //Left = item.Bounds.X, //Top = item.Bounds.Y, }; id.Show(); displayIDWindows.Add(id); } }
public DisplaySelectWindow() { InitializeComponent(); selectedDisplay = null; DisplayLB.ItemsSource = displayLBItems; UpdateDisplayListBox(); //screen identification. foreach (var item in System.Windows.Forms.Screen.AllScreens) { DisplayID id = new DisplayID(item.DeviceName, item.Bounds.X, item.Bounds.Y) { //does not work properly in different dpi situations, using setwindowpos instead. //Left = item.Bounds.X, //Top = item.Bounds.Y }; id.Show(); displayIDWindows.Add(id); } }