当前位置: 首页>>代码示例>>C#>>正文


C# WebBrowser.BringToFront方法代码示例

本文整理汇总了C#中System.Windows.Forms.WebBrowser.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser.BringToFront方法的具体用法?C# WebBrowser.BringToFront怎么用?C# WebBrowser.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.WebBrowser的用法示例。


在下文中一共展示了WebBrowser.BringToFront方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExtractSnapshot

        internal static Image ExtractSnapshot(WebBrowser browser)
        {
            browser.ClientSize = new Size(850, 1500);

            Rectangle bounds = browser.Document.Body.ScrollRectangle;
            IHTMLElement2 body = browser.Document.Body.DomElement as IHTMLElement2;
            IHTMLElement2 doc = (browser.Document.DomDocument as IHTMLDocument3).documentElement as IHTMLElement2;
            int scrollHeight = Math.Max(body.scrollHeight, bounds.Height);
            int scrollWidth = Math.Max(body.scrollWidth, bounds.Width);
            scrollHeight = Math.Max(body.scrollHeight, scrollHeight);
            scrollWidth = Math.Max(doc.scrollWidth, scrollWidth);
            Rectangle finalBounds = new Rectangle(0, 0, scrollWidth, scrollHeight);

            browser.ClientSize = finalBounds.Size;
            var bitmap = new Bitmap(scrollWidth, scrollHeight);
            browser.BringToFront();
            browser.DrawToBitmap(bitmap, finalBounds);

            return bitmap;
        }
开发者ID:ucswift,项目名称:CMWatcher,代码行数:20,代码来源:WebImageService.cs

示例2: button_source_Click

 private void button_source_Click(object sender, EventArgs e)
 {
     wb = new WebBrowser();
     wb.Size = new Size(findControl("console_panel").Size.Width, Size.Height - sizeManager_console.Location.Y);
     wb.Location = sizeManager_console.Location;
     wb.Name = "wb";
     Controls.Add(wb);
     modVisible(new Control[] { getTBox("console"), getTBox("editor"), findControl("console_panel"), findControl("editor_panel") }, false);
     wb.Show();
     wb.BringToFront();
     wb.Url = new Uri("https://github.com/lyokofirelyte/PseudoCompiler");
     modVisible(new Control[] { button_refresh, panel_refresh, button_run_code, panel_run_code, button_open_new_file, panel_open_new_file, panel_stop_code, button_stop_code }, false);
     modVisible(new Control[] { panel_save, button_save }, false);
 }
开发者ID:lyokofirelyte,项目名称:PseudoCompiler,代码行数:14,代码来源:Form1.cs

示例3: UpdateView

        void UpdateView()
        {
            CodeFormat format = CodeFormat.Disassemble;

            if (radioCFDecompile.Checked)
            {
                format = CodeFormat.ScruffDecompile;
            }
            else if (radioFullDecompile.Checked)
            {
                format = CodeFormat.FullDecompile;
            }

            string code = _scriptFile.GetCode(format);

            if (_browser != null)
            {
                Controls.Remove(_browser);
            }

            _browser = new WebBrowser();
            _browser.Dock = DockStyle.Fill;
            _browser.AllowNavigation = false;
            _browser.AllowWebBrowserDrop = false;
            //_browser.WebBrowserShortcutsEnabled = false;
            _browser.IsWebBrowserContextMenuEnabled = false;

            if (radioFullDecompile.Checked & code.Length < 0x10000)
            {
                var codeFormat = new ScruffFormat();
                string text = codeFormat.FormatCode(new MemoryStream(Encoding.ASCII.GetBytes(code)));
                text = "<style>" +
                            ".csharpcode, .csharpcode pre" + 
                            "{" + 
                            "  font-size: 10pt;" + 
                            "  color: black;" + 
                            "  font-family: Consolas, Courier New, Courier, Monospace;" + 
                            "  background-color: #ffffff;" + 
                            "}" + 
                            ".csharpcode pre { margin: 0em; }" + 
                            ".csharpcode .rem { color: #008000; }" + 
                            ".csharpcode .kwrd { color: #0000ff; }" + 
                            ".csharpcode .str { color: #006080; }" + 
                            ".csharpcode .op { color: #0000c0; }" + 
                            ".csharpcode .preproc { color: #cc6633; }" + 
                            ".csharpcode .asp { background-color: #ffff00; }" + 
                            ".csharpcode .html { color: #800000; }" + 
                            ".csharpcode .attr { color: #ff0000; }" + 
                            ".csharpcode .alt " + 
                            "{" + 
                            "  background-color: #f4f4f4;" + 
                            "  width: 100%;" + 
                            "  margin: 0em;" + 
                            "}" + 
                            ".csharpcode .lnum { color: #606060; }" + 
                        "</style>" +
                        text;
                _browser.DocumentText = text;
            }
            else
            {
                string text = "<pre>" + code.Replace("\n", "<br/>") + "</pre>";
                _browser.DocumentText = text;
            }

            Controls.Add(_browser);
            _browser.BringToFront();
        }
开发者ID:tjhorner,项目名称:gtaivtools,代码行数:68,代码来源:ScriptView.cs

示例4: GenerateThumbnailFromCompletedPage

 private void GenerateThumbnailFromCompletedPage(WebBrowser m_WebBrowser)
 {
     m_WebBrowser.ClientSize = new Size(this.m_BrowserWidth, this.m_BrowserHeight);
     m_WebBrowser.ScrollBarsEnabled = false;
     m_Bitmap = new Bitmap(m_WebBrowser.Bounds.Width, m_WebBrowser.Bounds.Height);
     m_WebBrowser.BringToFront();
     m_WebBrowser.DrawToBitmap(m_Bitmap, m_WebBrowser.Bounds);
     m_Bitmap = (Bitmap) m_Bitmap.GetThumbnailImage(m_ThumbnailWidth, m_ThumbnailHeight, null, IntPtr.Zero);
 }
开发者ID:kallex,项目名称:Caloom,代码行数:9,代码来源:WebsiteThumbnailImage.cs

示例5: ShowInfoPage

        public void ShowInfoPage()
        {
            this.SuspendLayout();
            WebBrowser webStart = new WebBrowser();
            PNLlist.Controls.Add(webStart);
            webStart.Visible = false;
            webStart.ScriptErrorsSuppressed = true;
            webStart.ScrollBarsEnabled = false;
            webStart.Dock = DockStyle.Fill;
            webStart.BringToFront();

            Button btnClose = new Button();
            this.Controls.Add(btnClose);
            btnClose.Visible = false;
            btnClose.Size = new Size(PNLlist.Width - 6, 35);
            btnClose.Location = new Point(15, PNLlist.Height - 39 + 39);
            btnClose.FlatAppearance.BorderColor = Color.Gray;
            btnClose.BackColor = Color.FromArgb(64, 64, 64);
            btnClose.ForeColor = Color.WhiteSmoke;
            btnClose.Text = "Close";
            btnClose.FlatStyle = FlatStyle.Flat;
            btnClose.BringToFront();
            this.ResumeLayout();

            btnClose.Click += (e, s) =>
            {
                PNLlist.Controls.Remove(webStart);
                this.Controls.Remove(btnClose);
            };
            webStart.Navigated += (e, s) =>
            {
                if (!webStart.Document.ToString().ToLower().Contains("checking your"))
                {
                    webStart.Show();
                    btnClose.Show();
                }
            };
            webStart.Navigate("http://www.realmbot.xyz/hello.html");
        }
开发者ID:kristjan0,项目名称:RealmBotEventNotifier,代码行数:39,代码来源:frmMain.cs

示例6: ShowEmbeddedBrowser

 private void ShowEmbeddedBrowser(WebBrowser embeddedBrowser)
 {
     embeddedBrowser.Dock = DockStyle.Fill;
     embeddedBrowser.IsWebBrowserContextMenuEnabled = false;
     embeddedBrowser.Parent = this;
     embeddedBrowser.Visible = true;
     embeddedBrowser.BringToFront();
     advancedAreaContainer.Visible = false;
 }
开发者ID:27miller87,项目名称:MultiMiner,代码行数:9,代码来源:MinerForm.cs


注:本文中的System.Windows.Forms.WebBrowser.BringToFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。