Wince实现电量、横屏(仿手机电量显示 右上角)

23 篇文章 0 订阅

 

下载点击这

 

主要代码如下:

 /// <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;


效果图:


 

-------------------------

更新版本(效果图):

(桌面部分内容,受保护已抹掉)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值