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

调用微软提供给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

原文地址:https://www.cnblogs.com/tiaoma888/p/6628518.html