Output to another Window

被刻印的时光 ゝ 提交于 2019-12-02 11:41:16

The first thing is to get information about available screens. You can get that from Screen.AllScreens. Next is to determine how many screens there are (note that there may be more than two). Then you need to decide how to identify the "second" screen (for instance, the first one that where the Primary property is false.

When that is done, I guess that the simplest way is to move the form to a location that is within the Bounds of the desired screen, and then maximize it.

Here is a sample method that opens a form maximized on a specified screen:

public static void ShowMaximizedOnScreen(Screen screen, Form form)
{
    form.Location = screen.Bounds.Location;
    form.WindowState = FormWindowState.Maximized;
    form.StartPosition = FormStartPosition.Manual;
    form.Show();
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!