110,500
社区成员
发帖
与我相关
我的任务
分享
private void Form5_Load(object sender, EventArgs e)
{
int width= Screen.PrimaryScreen.Bounds.Width;//得到横分辨率
int height= Screen.PrimaryScreen.Bounds.Height;//得到纵分辨率
this.Height = Convert.ToInt32(height * 0.6);//设置窗体的高
}
using System.Runtime.InteropServices;
/// <summary>
/// 获取操作系统分辨率
/// </summary>
/// <param name="nIndex"></param>
/// <returns></returns>
[DllImport("user32.dll")]
public static extern int GetSystemMetrics(int nIndex);