public Form1() { // GeckoFX initialization Skybound.Gecko.Xpcom.Initialize(Application.StartupPath + @"\xulrunner"); InitializeComponent(); // start CouchDB runToolStripButton_Click(runToolStripButton, null); geckoBrowser = new Skybound.Gecko.GeckoWebBrowser(); geckoBrowser.Parent = this.splitContainer1.Panel1; geckoBrowser.Dock = DockStyle.Fill; geckoBrowser.Navigated += new Skybound.Gecko.GeckoNavigatedEventHandler(geckoBrowser_Navigated); }
static void geckowebBrowser_HandleCreated(object sender, EventArgs e) { Skybound.Gecko.GeckoWebBrowser geckowebBrowser = sender as Skybound.Gecko.GeckoWebBrowser; geckowebBrowser.Navigate(geckowebBrowser.Tag.ToString()); }
public void addGeckoTab(string url = "about:blank") { log("Initialized new tab"); try { //EduardoOliveiraAndColinVerhey.MDITabControl code Form foobar = new Form(); //foobar.Location.X = 5; //foobar.Location.Y = 502; //tabControl2.TabPages.Add(foobar); Skybound.Gecko.GeckoWebBrowser browser1 = new Skybound.Gecko.GeckoWebBrowser(); foobar.Controls.Add(browser1); tabControl1.TabPages.Add(foobar); foobar.Select(); foobar.BringToFront(); tabControl1.SelectItem(tabControl1.TabPages[foobar]); foobar.Focus(); foobar.Activate(); browser1.Dock = DockStyle.Fill; browser1.Navigated += new Skybound.Gecko.GeckoNavigatedEventHandler(nav); browser1.Navigating += new Skybound.Gecko.GeckoNavigatingEventHandler(browser1_Navigating); browser1.ProgressChanged += new Skybound.Gecko.GeckoProgressEventHandler(loading); browser1.CreateWindow += new Skybound.Gecko.GeckoCreateWindowEventHandler(geckoWebBrowser1_CreateWindow); browser1.StatusTextChanged += new EventHandler(changing); browser1.BackColor = System.Drawing.Color.White; browser1.DomMouseDown += new Skybound.Gecko.GeckoDomMouseEventHandler(browser1_DomMouseDown); browser1.DocumentCompleted += new EventHandler(browser1_DocumentCompleted); //browser1.DomClick += new Skybound.Gecko.GeckoDomEventHandler(browser1_DomClick); //1browser1.DomContextMenu += new Skybound.Gecko.GeckoDomMouseEventHandler(browser1_DomContextMenu); browser1.NoDefaultContextMenu = true; browser1.ContextMenuStrip = mainCM; browser1.DocumentTitleChanged += new EventHandler(browser_DocumentTitleChanged); //browser1.MouseWheel += new MouseEventHandler(browser1_MouseWheel); foobar.GotFocus += new EventHandler(select); foobar.Disposed += new EventHandler(dd); //browser1.AllowDnsPrefetch = false; //browser1.BlockPopups = true; foobar.Tag = "-"; //Thread.Sleep(1000); rtab(); textBox1.Focus(); foobar.Focus(); browser1.CreateControl(); toGo = url; foobar.Select(); } catch { } }
public void addGeckoTab() { //mditabcontrol code Form foobar = new Form(); //foobar.Location.X = 5; //foobar.Location.Y = 502; tabControl1.TabPages.Add(foobar); //tabControl2.TabPages.Add(foobar); Skybound.Gecko.GeckoWebBrowser browser1 = new Skybound.Gecko.GeckoWebBrowser(); foobar.Controls.Add(browser1); browser1.Dock = DockStyle.Fill; browser1.Navigated += new Skybound.Gecko.GeckoNavigatedEventHandler(nav); browser1.ProgressChanged += new Skybound.Gecko.GeckoProgressEventHandler(loading); browser1.CreateWindow += new Skybound.Gecko.GeckoCreateWindowEventHandler(geckoWebBrowser1_CreateWindow); browser1.ShowContextMenu += new Skybound.Gecko.GeckoContextMenuEventHandler(menu); browser1.StatusTextChanged += new EventHandler(changing); browser1.BackColor = System.Drawing.Color.White; browser1.ContextMenuStrip = browserCM; browser1.NoDefaultContextMenu = true; browser1.DomMouseDown += new Skybound.Gecko.GeckoDomMouseEventHandler(browser1_DomMouseDown); //browser1.Navigate("about:blank"); foobar.GotFocus+= new EventHandler(select); foobar.Disposed += new EventHandler(dd); //browser1.AllowDnsPrefetch = false; //browser1.BlockPopups = true; textBox1.Text = "about:blank"; foobar.Focus(); rtab(); }