private void button1_Click(object sender, EventArgs e)
        {
            TabPage myTabPage = new TabPage("Nueva Pestaña");

            tc_pestanas.TabPages.Add(myTabPage);
            Navegador nav = new Navegador((TabPage)myTabPage);

            nav.TopLevel = false;
            myTabPage.Controls.Add(nav);
            myTabPage.Tag = nav;
            var  @delegate = new showForm(nuevaVentana);
            Task hilo      = new Task(() => myTabPage.BeginInvoke(@delegate, nav));

            hilo.Start();
            hilos.Add(hilo);
            ventanas.Add(nav);
        }
        public Home()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;;
            Navegador nav = new Navegador(tabPage1);

            nav.TopLevel = false;
            tabPage1.Controls.Add(nav);
            tabPage1.Tag = nav;
            nav.Show();
            AppContext.Instance.set("Descargar", true);
            Semaforo s = new Semaforo(true);

            s.initSemaforo();
            AppContext.Instance.set("Semaforo", s);
            cargarHistorial();
            cargarDescargas();
        }
        public void nuevaVentana(String url)
        {
            TabPage myTabPage = new TabPage(url);

            tc_pestanas.TabPages.Add(myTabPage);
            Navegador nav = new Navegador((TabPage)myTabPage);

            nav.TopLevel = false;
            myTabPage.Controls.Add(nav);
            myTabPage.Tag = nav;
            var  @delegate = new showForm(nuevaVentana);
            Task hilo      = new Task(() => myTabPage.BeginInvoke(@delegate, nav));

            hilo.Start();
            hilos.Add(hilo);
            ventanas.Add(nav);
            nav.Navegar(url);
        }
 private void nuevaVentana(Navegador nav)
 {
     nav.Show();
 }