主要代码如下:
/// <summary>
/// 横屏
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnhp_Click(object sender, EventArgs e)
{
if (btnhp.Text=="横屏")
{
this.Size = new Size(465, 272);
Microsoft.WindowsCE.Forms.SystemSettings.ScreenOrientation = Microsoft.WindowsCE.Forms.ScreenOrientation.Angle0;
btnhp.Text = "还原";
}
else
{
this.Size = new Size(272, 465);
Microsoft.WindowsCE.Forms.SystemSettings.ScreenOrientation = Microsoft.WindowsCE.Forms.ScreenOrientation.Angle90;
btnhp.Text = "横屏";
}
}
//60秒自动获取最新电量
int x = Screen.PrimaryScreen.WorkingArea.Right - this.Height;
int y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Width;
this.Location = new Point(100, 2);//设置窗体在屏幕右上角显示
prodl.Value = WincePda.WinCeCoredll.GetBattery();
labdl.Text = WincePda.WinCeCoredll.GetBattery().ToString() + "%";
//60秒执行重新获得电量
timer1.Enabled = true;
效果图:
-------------------------
更新版本(效果图):
(桌面部分内容,受保护已抹掉)