using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;u ...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
namespace WinClient
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
try
{
//設置窗體無邊框
this.FormBorderStyle = FormBorderStyle.None;
//視窗置頂
this.TopMost = true;
//開始位置由 Location 決定
this.StartPosition = FormStartPosition.Manual;
Screen[] screens = System.Windows.Forms.Screen.AllScreens;
if (screens.Length >= 2)
{
//獲取擴展屏
Screen childerScreen = screens[1];
//設置寬高
this.Width = childerScreen.Bounds.Width;
this.Height = childerScreen.Bounds.Height;
//設置顯示位置
this.Location = childerScreen.WorkingArea.Location;
}
else
{
MessageBox.Show("只有一個顯示器");
}
}
catch (Exception ex)
{
//錯誤日誌處理
}
}
}
}