c# 窗体 显示居中 wince

来源:互联网 发布:淘宝买实体娃娃 编辑:程序博客网 时间:2024/05/02 00:06


using System.Runtime.InteropServices;[DllImport("Coredll.dll")]public static extern int GetSystemMetrics(int nIndex);         private void FormAppClose_Load(object sender, EventArgs e)        {            int x,y;            int swidth = GetSystemMetrics(0);            int sheight = GetSystemMetrics(1);            x = (swidth-this.Width)/2;            y = (sheight-this.Height)/2;            this.Location = new Point(x, y);        }

0 0