예제 #1
0
        private void webForm_Load(object sender, EventArgs e)
        {
            if (MenuForm.isTest)
            {
                this.SizeChanged    += new System.EventHandler(this.WebForm_SizeChanged);
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
            }
            openWebFormDelegate = new openWebForm(this.openWebFormByUrl);
            this.webBrowser1.ScriptErrorsSuppressed = true;
            this.webBrowser1.ScrollBarsEnabled      = false;
            if (wbh != null)
            {
                wbh.init(webBrowser1, MainForm.webErrHtml);
            }
            if (jbh != null)
            {
                jbh.init(webBrowser1, this);
            }
            //setIEcomp();

            loadByUrl();
            //  webBrowser1.MouseMove += new MouseEventHandler(control_MouseMove);
                      // webBrowser1.MouseDown += new MouseEventHandler(control_MouseDown);
                      // webBrowser1.MouseUp += new MouseEventHandler(control_MouseUp);
        }
예제 #2
0
        private void MenuForm_Load(object sender, EventArgs e)
        {
            openWebFormDelegate    = new openWebForm(this.openWebFormByUrl);
            stockDelegate          = new InNoneOutVoidDelegate(this.Stock);
            showNewMessageDelegate = new ShowNewMessageDelegate(this.showNewMessage);
            // wbh = new WebBrowserHelper();
            if (wbh != null)
            {
                wbh.init(webBrowser1, MainForm.menuErrHtml);
            }
            if (jbh != null)
            {
                jbh.init(webBrowser1, this);
            }
            this.webBrowser1.ScriptErrorsSuppressed = true;
            this.webBrowser1.ScrollBarsEnabled      = false;
            // string str1 = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            //  webBrowser1.ObjectForScripting = this;
            // webBrowser1.ScriptErrorsSuppressed = true;


            stockIcon.Text = Program.getMyTextClassByIndex(0);
            this.Location  = new Point(0 - this.Width, 0 - this.Height);
            // this.Hide();
            if (isTest)
            {
                this.SizeChanged    += new System.EventHandler(this.WebForm_SizeChanged);
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
            }
            loadByUrl();
        }
예제 #3
0
        protected void mainFormLoad()
        {
            // string str1 = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;

            //在应用程序选项卡中点击程序集信息,然后勾选“使程序集COM可见”。
            // setIEcomp();
            openWebFormDelegate = new openWebForm(this.openWebForm);

            if (File.Exists(Program.configFilePath))
            {
                ReadINI RI = new ReadINI(Program.configFilePath);
                try
                {
                    mainUrl = RI.GetValue("Basic", "BaseUrl");

                    if (mainUrl == null || mainUrl == "")
                    {
                        MessageBox.Show(Program.getMyTextClassByIndex(1));
                        this.Close();
                    }
                }
                catch
                {
                    MessageBox.Show(Program.getMyTextClassByIndex(2));
                    this.Close();
                }

                /*
                 * try
                 * {
                 *  mainTitleName = RI.GetValue("WindowData", "TitleName");
                 *
                 *  if (mainTitleName == null || mainTitleName == "")
                 *  {
                 *      mainTitleName = " ";
                 *  }
                 * }
                 * catch
                 * {
                 * }*/

                try
                {
                    webErrHtml = RI.GetValue("WindowData", "WebErrHtml");

                    if (webErrHtml == null || webErrHtml == "")
                    {
                        webErrHtml = Application.StartupPath + @"\html-cs\CS-error.html";
                    }
                    else
                    {
                        webErrHtml = Application.StartupPath + webErrHtml;
                    }
                }
                catch
                {
                }

                try
                {
                    menuErrHtml = RI.GetValue("WindowData", "MenuErrHtml");

                    if (menuErrHtml == null || menuErrHtml == "")
                    {
                        menuErrHtml = Application.StartupPath + @"\html-cs\CS-menu-error.html";
                    }
                    else
                    {
                        menuErrHtml = Application.StartupPath + menuErrHtml;
                    }
                }
                catch
                {
                }



                try
                {
                    webTimeOutMillisecond = Convert.ToInt32(RI.GetValue("WindowData", "WebTimeOutMillisecond"));
                }
                catch
                {
                }

                try
                {
                    menuTimeOutMillisecond = Convert.ToInt32(RI.GetValue("WindowData", "MenuTimeOutMillisecond"));
                }
                catch
                {
                }
            }
            else
            {
                MessageBox.Show(Program.getMyTextClassByIndex(3));
                this.Close();
            }
            setAutoStart();

            //  this.Location = new Point(0 - this.Width, 0 - this.Height);
            // this.Hide();
            if (isTest)
            {
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
            }
        }