Exemple #1
0
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            object o = null;

            axWebBrowser1.Navigate("http://www.devcomponents.com/dotnetbar", ref o, ref o, ref o, ref o);
        }
        private void print_btn_Click(object sender, EventArgs e)
        {
            OnPrintClick(EventArgs.Empty);
            object em = null;

            GF.showLoading((this.Parent as Panel).Parent as Form);
            using (AxSHDocVw.AxWebBrowser wb = new AxSHDocVw.AxWebBrowser())
            {
                wb.CreateControl();
                wb.Left = -1000;
                wb.Top  = -1000;
                wb.Navigate(Properties.Settings.Default.webserver_url + url);
                for (; wb.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE;)
                {
                    System.Windows.Forms.Application.DoEvents();
                }
                GF.closeLoading();
                try
                {
                    SHDocVw.OLECMDF eQuery = wb.QueryStatusWB(SHDocVw.OLECMDID.OLECMDID_PAGESETUP);
                    wb.ExecWB(SHDocVw.OLECMDID.OLECMDID_PAGESETUP, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER, ref em, ref em);
                    wb.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER, ref em, ref em);
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Show a HTML link.
        /// </summary>
        /// <param name="theHtmlFullFileName">The HTML link.</param>
        /// <param name="isNewURL">Indicates if this is a new link or an existing link (back/forward button is used)</param>
        public void ShowHtml(string theHtmlFullFileName)
        {
            object Zero        = 0;
            object EmptyString = "";

            _AxWebBrowser.Navigate(theHtmlFullFileName, ref Zero, ref EmptyString, ref EmptyString, ref EmptyString);
        }
        public DlgHelpTopics()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            RegistryKey regkey = Registry.CurrentUser.OpenSubKey(LingTreeApp.m_strRegKey);

            if (regkey != null)
            {
                // Window location
                int iX     = Convert.ToInt32((string)regkey.GetValue(m_strDlgHTLocationX));
                int iY     = Convert.ToInt32((string)regkey.GetValue(m_strDlgHTLocationY));
                int iWidth = Convert.ToInt32((string)regkey.GetValue(m_strDlgHTSizeWidth));
                iWidth = Math.Max(500, iWidth);
                int iHeight = Convert.ToInt32((string)regkey.GetValue(m_strDlgHTSizeHeight));
                iHeight       = Math.Max(500, iHeight);
                StartPosition = FormStartPosition.Manual;
                this.Location = new Point(iX, iY);
                this.Size     = new Size(iWidth, iHeight);
                regkey.Close();
            }

            string strCurDir        = Application.StartupPath;
            string strHelpTopicsHtm = Path.Combine(strCurDir, @"Documentation\HelpTopics.htm");

            System.Object nullObject = 0;
            System.Object nullObjStr = "";
            axwbHelpTopics.Navigate(strHelpTopicsHtm, ref nullObject, ref nullObjStr, ref
                                    nullObjStr, ref nullObjStr);
        }
Exemple #5
0
        public static void openFileInWebBrowser(AxSHDocVw.AxWebBrowser axWBtoUse, string strPathToFileToOpen)
        {
            axWBtoUse.Visible = true;
            object ipNull = IntPtr.Zero;

            axWBtoUse.Navigate(strPathToFileToOpen, ref ipNull, ref ipNull, ref ipNull, ref ipNull);
        }
        void UpdateTab()
        {
            tabControl1.TabPages.Clear();
            string [] dirs = System.IO.Directory.GetDirectories("HackUser\\", "*");
            foreach (string dir in dirs)
            {
                //string []str = folder.FolderPath.Split('\\');
                string [] str     = dir.Split('\\');
                string    version = str[str.Length - 1];

                System.Windows.Forms.TabPage tab = new TabPage(version);

                AxSHDocVw.AxWebBrowser web = new AxSHDocVw.AxWebBrowser();

                System.Object nullObject = 0;

                tab.Controls.Add(web);
                tabControl1.TabPages.Add(tab);


                web.Dock = DockStyle.Fill;

                try
                {
                    web.Navigate("file://" + Application.StartupPath + "\\report\\" + version + "_dmp.html", ref nullObject, ref nullObject, ref nullObject, ref nullObject);
                }
                catch (System.Exception e)
                {
                    e.ToString();
                }
            }
        }
        private void LoadPage()
        {
            string WebURL = URL.Text;

            WebBrowser.Navigate(WebURL, ref oMissing, ref oMissing,
                                ref oMissing, ref oMissing);
        }
Exemple #8
0
        private void ShowDetailHtml(string theHtmlFullFileName)
        {
            object Zero        = 0;
            object EmptyString = "";

            WebBrowserDetail.Navigate(theHtmlFullFileName, ref Zero, ref EmptyString, ref EmptyString, ref EmptyString);
        }
        private void CloseOutputFile()
        {
            m_graphicViewerWriter.WriteLine("</body></html>");
            m_graphicViewerWriter.Close();

            object empty = null;

            axWebBrowser.Navigate(m_outFile, ref empty, ref empty, ref empty, ref empty);
        }
Exemple #10
0
        public Form1()
        {
            InitializeComponent();

            object a = 0;
            object b = 0;
            object c = 0;
            object d = 0;

            axWebBrowser1.Navigate("www.microsoft.com", ref a, ref b, ref c, ref d);
        }
Exemple #11
0
        private void ShowMail(string fileName)
        {
            try
            {
                int    pos      = fileName.LastIndexOf(".");
                string mainName = fileName.Substring(0, pos);
                string htmlName = mainName + ".htm";

                string tempFolder = mainName;
                if (!File.Exists(htmlName))
                {                       //we haven't generate the html for this email, generate it now.
                    _GenerateHtmlForEmail(htmlName, fileName, tempFolder);
                }

                object empty = System.Reflection.Missing.Value;
                webMail.Navigate(htmlName);
            }
            catch (Exception ep)
            {
                MessageBox.Show(ep.Message);
            }
        }
Exemple #12
0
        private void WriteHTML(string html)
        {
            string basepath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", "").Replace("/", @"\");

            basepath = System.IO.Path.GetDirectoryName(basepath) + @"\";
            using (System.IO.StreamWriter hwriter = new System.IO.StreamWriter(basepath + "print.html", false)) {
                hwriter.Write(html);
                hwriter.Flush();
                hwriter.Close();
            }
            object thingy = null;

            axWebBrowser1.Navigate(basepath + "print.html", ref thingy, ref thingy, ref thingy, ref thingy);
        }
        private void Form1_Load(object sender, System.EventArgs e)
        {
            this.axWebBrowser1.BeginInit();

            this.Width     = ww;
            this.Height    = hh;
            this.BackColor = bgcolor;

            this.axWebBrowser1.Left   = 10;
            this.axWebBrowser1.Top    = 5;
            this.axWebBrowser1.Width  = this.ClientSize.Width - 20;
            this.axWebBrowser1.Height = this.ClientSize.Height - 15;

            this.axWebBrowser1.EndInit();

            object o     = string.Empty;
            object flags = 0;

            axWebBrowser1.Navigate("about:blank", ref flags, ref o, ref o, ref o);

            ICustomDoc cDoc = (ICustomDoc)this.axWebBrowser1.Document;

            cDoc.SetUIHandler((IDocHostUIHandler)this);

            if (htmlfn == null)
            {
                htmlfn = "about:blank";
            }
            else
            {
                if (htmlfn.IndexOf(":") < 0)
                {
                    htmlfn = Directory.GetCurrentDirectory() + "\\" + htmlfn;
                }
            }
            axWebBrowser1.Navigate(htmlfn, ref flags, ref o, ref o, ref o);
        }
Exemple #14
0
        private void gridEX_SelectionChanged(object sender, System.EventArgs e)
        {
            if (File.Exists(_tempFile))
            {
                try
                {
                    File.Delete(_tempFile);
                }
                catch {}
            }

            if (gridEX.SelectedItems.Count == 0)
            {
                return;
            }

            GridEXSelectedItem i = gridEX.SelectedItems[0];

            if (i != null)
            {
                GridEXRow row = i.GetRow();

                string idBandeja     = ( string )row.Cells["IdBandeja"].Value;
                string nombreArchivo = ( string )row.Cells["NombreArchivo"].Value;
                byte[] bytes         = _bandeja.GetContenidoArhivo(idBandeja, nombreArchivo);

                _tempFile = Path.ChangeExtension(Path.GetTempFileName(), ".xml");
                try
                {
                    File.Delete(Path.ChangeExtension(_tempFile, ".tmp"));
                }
                catch
                {
                }

                FileStream fs = new FileStream(_tempFile, FileMode.Create);
                ZipUtil.Decompress(bytes, fs);
                fs.Flush();
                fs.Close();

                object o = null;

                axWebBrowser.Navigate(_tempFile, ref o, ref o, ref o, ref o);
            }


            //Job j = Job.Read( bytes );
        }
Exemple #15
0
 private void Form_Main_Ini(string url_)
 {
     InitializeComponent();
     toolStrip2_SizeChanged(null, null);
     Show();
     Application.DoEvents();
     AxSHDocVw.AxWebBrowser webBrowser = IniWebBrowser();
     currentWebBrowser = webBrowser;
     if (string.IsNullOrEmpty(url_))
     {
         webBrowser.GoHome();
     }
     else
     {
         webBrowser.Navigate(url_);
     }
 }
Exemple #16
0
        public void ShowFile(string sFilename, string sCaption, bool bDeleteOnClose)
        {
#if !__MonoCS__
            object nullObj = null;
            axWebBrowser1.Navigate(sFilename, ref nullObj, ref nullObj, ref nullObj, ref nullObj);
            m_sFilename      = sFilename;
            m_bDeleteOnClose = bDeleteOnClose;
#else
            //Do not set DeleteOnClose if it does not work
            MessageBox.Show(this, "XML viewing not Implemented on non-windows. Please open \""
                            + sFilename + "\" manually.");
#endif
            if (sCaption != null)
            {
                Text = sCaption;
            }
        }
Exemple #17
0
        private void RefreshClientArea()
        {
            Demo currentDemo = GetCurrentDemo();

            statusBar.Panels[1].Text = "";
            statusBar.Panels[2].Text = "";

            //what button is pushed?
            if (btDemo.Pushed)
            {
                BaseDemoControl demos = currentDemo.GetDemo(connection, new WriteStatusHandler(OnWriteStatus));
                this.pnDemo.Controls.Clear();
                demos.Parent = this.pnDemo;
                demos.Dock   = System.Windows.Forms.DockStyle.Fill;
                OnWriteStatus(demos);
            }
            else if (btSource.Pushed)
            {
                string fullPath = currentDemo.CodeFileName;
                if (File.Exists(fullPath))
                {
                    using (StreamReader sr = new StreamReader(fullPath)) {
                        tbSource.Text = sr.ReadToEnd();
                    }
                }
            }
            else if (btSql.Pushed)
            {
                textSql.Text = (btCreate.Pushed ? currentDemo.CreateSql : currentDemo.DropSql);
                if (textSql.Text == "")
                {
                    textSql.Text = (btCreate.Pushed ? createSqlText : dropSqlText);
                }
            }
            else if (btDescription.Pushed)
            {
                object o = new Object();
                currentDemo.GenerateReadMe(tempHtmlFile);
                webDescription.Navigate(tempHtmlFile, ref o, ref o, ref o, ref o);
            }
        }
        private void DocExplorer_Load(object sender, System.EventArgs e)
        {
            //Find the Office document.
            //openFileDialog1.FileName = "";
            //openFileDialog1.ShowDialog();
            //strFileName = openFileDialog1.FileName;

            //If the user does not cancel, open the document.

            //this.FormBorderStyle=FormBorderStyle.None;
            //this.WindowState= FormWindowState.Maximized;
            //this.MaximizeBox = false;
            //this.FormBorderStyle=FormBorderStyle.None;
            //this.ultraDockManager1

            if (strPath.Length != 0)
            {
                Object refmissing = System.Reflection.Missing.Value;
                //oDocument = null;
                axWebBrowser1.Navigate(strPath, ref refmissing, ref refmissing, ref refmissing, ref refmissing);
                this.Text = strName;
            }
        }
Exemple #19
0
        private void frmBrowse_Load(object sender, System.EventArgs e)
        {
            object obj = null;

            axWebBrowser1.Navigate(this.cbUrlList.Text, ref obj, ref obj, ref obj, ref obj);
        }
        public void Navigate(string url)
        {
            object o = null;

            axWebBrowser.Navigate(url, ref o, ref o, ref o, ref o);
        }