zoukankan      html  css  js  c++  java
  • WinCEWindow Mobile程序桌面化总结

    1、系统API处理

    将桌面、移动API分开处理

    2、一份代码,两个工程,分别编译

    添加已有文件时,使用添加链接,而不是添加附本

    3、桌面窗体出现位置不规律,样式不统一问题

    首先,在窗体类成员加入两个成员变量

            publicForm parentForm;    

            privatebool inited;       

    然后添加如下代码

     

            public ctor(Form parent)

                : this()

            {

                parentForm = parent;

            }

     

            protectedoverridevoid OnClosing(CancelEventArgs e)

            {

                if (parentForm != null)

                {

                    parentForm.Location = this.Location;

                    parentForm.Show();

                }

                base.OnClosing(e);

            }

     

            protectedoverridevoid OnActivated(EventArgs e)

            {

                if (!inited)

                {

                    inited = true;

                    parentForm.Hide();

                }

                base.OnActivated(e);

            }

     

            protectedoverridevoid OnLoad(EventArgs e)

            {

                if (parentForm != null)

                {

                    if (Environment.OSVersion.Platform == PlatformID.WinCE)

                    {

                        this.FormBorderStyle = FormBorderStyle.None;

                        this.ControlBox = false;

                    }

                    else

                    {

                        bool tmp = this.Visible;

                        this.Visible = false;

                        this.FormBorderStyle = FormBorderStyle.FixedSingle;

                        this.ControlBox = true;

                        this.MaximizeBox = false;

                        this.MinimizeBox = true;

                        this.Visible = tmp;

                    }

                    this.Location = parentForm.Location;

                    this.Size = parentForm.Size;

                }

                base.OnLoad(e);

            }

     

    使用时,使用窗体类带有Form parent参数的构造

  • 相关阅读:
    input 标签取消readOnly属性
    python selenium 跑脚本的时候按钮无法点击的解决办法
    Python Selenium 调用IE浏览器失败Unexpected error launching Internet Explorer解决方法
    转载--Python random模块(获取随机数)常用方法和使用例子
    转载--python selenium实现文件、图片上传
    ieDriver启动IE浏览器显示This is the initial start page for the WebDriver server的解决办法
    自动化测试用例设计学习心得总结
    关于selene安装插件ide不能识别插件的问题解决办法
    cmd 启动mysql
    最大子序列
  • 原文地址:https://www.cnblogs.com/hbhbice/p/4286643.html
Copyright © 2011-2022 走看看