Ejemplo n.º 1
0
        public string echarts_init(WebBrowser wb, Checkframe eh)
        {
            //首先判断系统浏览器支不支持相关操作
            try
            {
                GetBrowserVersion();
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
            string path = System.AppDomain.CurrentDomain.BaseDirectory + "index4.html";

            SetWebBrowserFeatures(10);
            wb.Url = new Uri(path);
            wb.DocumentCompleted += webBrowser1_DocumentCompleted;
            //防止 WebBrowser 控件打开拖放到其上的文件。
            wb.AllowWebBrowserDrop = false;

            //防止 WebBrowser 控件在用户右击它时显示其快捷菜单.
            wb.IsWebBrowserContextMenuEnabled = false;

            //以防止 WebBrowser 控件响应快捷键。
            wb.WebBrowserShortcutsEnabled = false;

            //以防止 WebBrowser 控件显示脚本代码问题的错误信息。
            wb.ScriptErrorsSuppressed = false;

            //(这个属性比较重要,可以通过这个属性,把WINFROM中的变量,传递到JS中,供内嵌的网页使用;但设置到的类型必须是COM可见的,所以要设置     [System.Runtime.InteropServices.ComVisibleAttribute(true)],因为我的值设置为this,所以这个特性要加载窗体类上)
            wb.ObjectForScripting = eh;
            wb.SizeChanged       += webBrowser1_SizeChanged;

            return("successed");
        }
Ejemplo n.º 2
0
        public QueryFrame queryf;                      //数据查询页面

        public HomeForm()
        {
            InitializeComponent();
            this.Load += new EventHandler(panel1_Load);

            //全屏,无边框
            this.WindowState     = FormWindowState.Maximized;
            this.FormBorderStyle = FormBorderStyle.None;

            checkf = new Checkframe();
            checkf.FormBorderStyle = FormBorderStyle.None; //隐藏子窗体边框(去除最小花,最大化,关闭等按钮)
            checkf.TopLevel        = false;                //指示子窗体非顶级窗体
            //Form checkf = new Form();
            //checkf.Load += new EventHandler(checkf_Load);
            this.panel1.Controls.Add(checkf);//将子窗体载入panel
            checkf.Show();
        }