winform强制扩展屏显示应用
本帖最后由 huok 于 2021-3-20 23:05 编辑//在窗体的OnLoad事件中调用该方法
protected void Form1_OnLoad(...) {
showOnMonitor(1);//index=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.Bounds.Left, sc.Bounds.Top);
// If you intend the form to be maximized, change it to normal then maximized.
this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Maximized;
}
+1 +2 学习 控件怎么自动适应这个呢? 123 是啊,控件如何适应这个呢?
页:
[1]