I have try a complete firefox in windows form application. I add some add tab page but can't a close by click. I have no idea to paste a cross button on the tab page.My coding part is :-
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedTab.Text == "+")
{
AddNewTab();
}
foreach (Control item in tabControl1.SelectedTab.Controls)
{
if (item.GetType() == typeof(WebBrowser))
{
WebBrowser wb = (WebBrowser)item;
toolStripButton1.Enabled = wb.CanGoBack;
toolStripButton2.Enabled = wb.CanGoForward;
}
}
this.wb.DocumentTitleChanged += Browser_DocumentTitleChanged;
this.wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wb_DocumentCompleted);
}
my closed function--
private void tabPage1_Click(object sender, EventArgs e)
{
if (tabControl1.SelectedTab != null)
{
tabControl1.SelectedTab.Dispose();
}
}
this function is closed the tab page by double click , I want to closed the tab page with the help of button same as FireFox working