您的位置:首页 > 其它

Wince 6.0获取设备的分辨率 自动设置窗体位置

2017-03-27 19:54 323 查看
调用微软提供给wince的API “coredll.dll”

[DllImport("coredll.dll")]
public static extern int GetSystemMetrics(int nIndex);

//屏幕宽
int nWidth = GetSystemMetrics(0);
//屏幕高
int nHeight = GetSystemMetrics(1);
Point point = new Point((nWidth - this.Width) / 2, (nHeight this.Height) / 2);
this.Location = point;


用系统自带的API获取屏幕分辨实现窗体居中,不管是哪个WinCE系统的设备都可以使用的方法。
http://www.ybtiaoma.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐