New Tab Button on a TabPage?
Hi I was wondering if It is possible to have a "new tab" button on a tabpage, like in IE how theres the little square you click to add a new tab. So normally I use a seperate button (like on a toolstrip) to create a new tab, but I want to have a button that floats next to the last tabpage in a tabcontrol that adds tabs
Also, if anyone knows how, it would be great to have a little button at the end of each tab that you can click to close the tab, like in google chrome (I have an attachment, something as close as possible to that would be great :)
like this is a normal "tabpage button"(the button where you click to show whatever is in the tab) [Tab Text.... ] and I want something like [Tab Text.... X] where the X is a button that closes the tab
Thanks!
Re: New Tab Button on a TabPage?
You could just keep adding a new 'tab' to the tab collection each time the "+" tab is clicked, and moving the "+" to the end.
Re: New Tab Button on a TabPage?
Here is a basic example. Requires you create a new tab named "Add" (Text as "+") in the 'TAbPages' collection first.:
vb Code:
Private Sub TabControl1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TabControl1.MouseClick
If TabControl1.SelectedTab.Name.ToString = "Add" Then Me.TabControl1.TabPages.Insert(Me.TabControl1.TabCount - 1, "NewTab" & Me.TabControl1.TabCount, "New")
End Sub