我有一个在单个监视器上运行的应用程序。它有网格。例如,如果应用程序可以容纳3个网格并且有4个项目要放置,则第4个项目应该转到第二个屏幕。 Algo:检查网格大小 如果网格大小超过3 在第二个(双)屏幕中打开剩余部分。
请让我知道如何解决这个问题。
答案 0 :(得分:3)
http://msdn.microsoft.com/de-de/library/system.windows.forms.screen.allscreens.aspx
void showOnMonitor(int showOnMonitor)
{
Screen[] sc;
sc = Screen.AllScreens;
//get all the screen width and heights
Form2 f = new Form2();
f.FormBorderStyle = FormBorderStyle.None;
f.Left = sc[showOnMonitor].Bounds.Width;
f.Top = sc[showOnMonitor].Bounds.Height;
f.StartPosition = FormStartPosition.Manual;
f.Show();
}
答案 1 :(得分:0)
检查类型System.Windows.Forms.Screen。