Dovrei usare Screen.PrimaryMonitor o Screen.AllScreens per l'impostazione Form.Location?
Domanda
Mentre i suggerimenti di domanda, dovrei essere il controllo del rettangolo per impostare un Form.Location (che è tratto da un file di impostazioni) in base a:
1.
if (settings.X < Screen.PrimaryScreen.WorkingArea...)
{
// Set the form's Location based on the settings object
}
o
2.
int width = 0;
foreach (Screen screen in Screen.AllScreens)
{
width += screen.WorkingArea.Width;
}
if (settings.X < width...)
{
// Set the form's Location based on the settings object
}
O c'è un semplice rivestimento che fa il compito di # 2? Sto lavorando su due monitor, ma la base di utenti può avere un qualsiasi numero di configurazioni.
Soluzione
Forse la mia risposta su questa diversa domanda aiuta anche in questo caso:
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow