Hello, I am trying to create a button in my vb form that when clicked will add a tab control to my form. The code is working, but if I click the button again, it adds another duplicate tab to the end. I only want to have one tab page added, no matter how many times the control is pressed.
This tab was previously hidden and I'm only showing it when the button is pressed. My code is:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TabControl1.TabPages.Remove(TabPage11)
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
TabControl1.TabPages.Add(TabPage11)
End Sub
Can anyone point me in the right direction to get this button to only show 1 copy of the hidden tab page?
This tab was previously hidden and I'm only showing it when the button is pressed. My code is:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TabControl1.TabPages.Remove(TabPage11)
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
TabControl1.TabPages.Add(TabPage11)
End Sub
Can anyone point me in the right direction to get this button to only show 1 copy of the hidden tab page?