private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { WebBrowser browser = (WebBrowser)sender; var index = pageControl.Items.IndexOf(browser); titles.setTitle(index, browser.DocumentTitle); }
private void goPageClick(object sender, EventArgs e) { if (sender is Label) { Label label = (Label)sender; titles.Index = titles.IndexOf(label.Parent); } else { titles.Index = titles.IndexOf((Control)sender); } pageControl.Index = titles.Index; var control = (Control)sender; mnuTitle = titles.gettitle(titles.index); if (mnuTitle.Items.Count > 1) { mnuTitle.Items[1].Visible = titles.Index > 0; } mnuTitle.Show(control, new Point(4, control.Height - 5)); titles.setTitle(pageControl.Index, pageControl.browser.DocumentTitle); }