c#输出到第二台显示器 [英] c# output to the 2nd monitor
本文介绍了c#输出到第二台显示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨所有
i必须制作一个显示输出到第二台显示器或LCD的应用程序
在原版显示器中它会显示整个应用程序的输出,但在第二个显示器上它只显示输出/结果。
它有可能吗?
就好像我有简单的2 + 2 = 4操作。
然后在原始屏幕上它将显示完整的2 + 2 = 4但在第二个监视器上它将显示输出为4.
hi all
i have to make a application which shows output to the second monitor or LCD
like in original monitor it will show whole application with out put , but on the second monitor it will only show output / result.
it it possible to that??
like if i have simple 2+2 = 4 operation .
then on original screen it will show complete 2+2 = 4 but on 2nd monitor it will show output as 4.
推荐答案
protected void Form1_OnLoad(...) {
showOnMonitor(1);
}
private void showOnMonitor(int showOnMonitor)
{
Screen[] sc;
sc = Screen.AllScreens;
if (showOnMonitor >= sc.Length) {
showOnMonitor = 0;
}
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(sc[showOnMonitor].Bounds.Left, sc[showOnMonitor].Bounds.Top);
// If you intend the form to be maximized, change it to normal then maximized.
this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Maximized;
}
复制自:
http://stackoverflow.com/questions/2561104 / how-do-i-ensure-a-form-display-on-a-monitor-in-a-dual-monitor-sc [ ^ ]
使用系统。 Windows.Forms.Screen [ ^ ]类获取有关可用监视器的信息。
然后使用表单的位置
和大小
将其移动到所需监视器的属性。
Use System.Windows.Forms.Screen[^] class to get information about available monitors.
Then use form'sLocation
andSize
properties to move it to desired monitor.
这篇关于c#输出到第二台显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文